netdev: bfin_mac: invalid data cache only once for each new rx skb buffer
[safe/jmp/linux-2.6] / drivers / net / ppp_async.c
index 30b1b33..6c2e8fa 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/init.h>
 #include <linux/jiffies.h>
+#include <linux/slab.h>
 #include <asm/uaccess.h>
 #include <asm/string.h>
 
 #define PPP_VERSION    "2.4.2"
 
-#define OBUFSIZE       256
+#define OBUFSIZE       4096
 
 /* Structure for storing local state. */
 struct asyncppp {
@@ -558,8 +559,8 @@ ppp_async_encode(struct asyncppp *ap)
                 * Start of a new packet - insert the leading FLAG
                 * character if necessary.
                 */
-               if (islcp || flag_time == 0
-                   || time_after_eq(jiffies, ap->last_xmit + flag_time))
+               if (islcp || flag_time == 0 ||
+                   time_after_eq(jiffies, ap->last_xmit + flag_time))
                        *buf++ = PPP_FLAG;
                ap->last_xmit = jiffies;
                fcs = PPP_INITFCS;
@@ -696,8 +697,8 @@ ppp_async_push(struct asyncppp *ap)
                 */
                clear_bit(XMIT_BUSY, &ap->xmit_flags);
                /* any more work to do? if not, exit the loop */
-               if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags)
-                     || (!tty_stuffed && ap->tpkt)))
+               if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) ||
+                     (!tty_stuffed && ap->tpkt)))
                        break;
                /* more work to do, see if we can do it now */
                if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags))
@@ -754,8 +755,8 @@ scan_ordinary(struct asyncppp *ap, const unsigned char *buf, int count)
 
        for (i = 0; i < count; ++i) {
                c = buf[i];
-               if (c == PPP_ESCAPE || c == PPP_FLAG
-                   || (c < 0x20 && (ap->raccm & (1 << c)) != 0))
+               if (c == PPP_ESCAPE || c == PPP_FLAG ||
+                   (c < 0x20 && (ap->raccm & (1 << c)) != 0))
                        break;
        }
        return i;