Merge branches 'core/debug', 'core/futexes', 'core/locking', 'core/rcu', 'core/signal...
[pandora-kernel.git] / drivers / net / ppp_generic.c
index 739b3ab..7e857e9 100644 (file)
@@ -581,12 +581,12 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        if (file == ppp->owner)
                                ppp_shutdown_interface(ppp);
                }
-               if (atomic_read(&file->f_count) <= 2) {
+               if (atomic_long_read(&file->f_count) <= 2) {
                        ppp_release(NULL, file);
                        err = 0;
                } else
-                       printk(KERN_DEBUG "PPPIOCDETACH file->f_count=%d\n",
-                              atomic_read(&file->f_count));
+                       printk(KERN_DEBUG "PPPIOCDETACH file->f_count=%ld\n",
+                              atomic_long_read(&file->f_count));
                unlock_kernel();
                return err;
        }
@@ -866,8 +866,8 @@ static int __init ppp_init(void)
                        err = PTR_ERR(ppp_class);
                        goto out_chrdev;
                }
-               device_create_drvdata(ppp_class, NULL, MKDEV(PPP_MAJOR, 0),
-                                     NULL, "ppp");
+               device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), NULL,
+                             "ppp");
        }
 
 out:
@@ -1833,9 +1833,11 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 
        /* If the queue is getting long, don't wait any longer for packets
           before the start of the queue. */
-       if (skb_queue_len(&ppp->mrq) >= PPP_MP_MAX_QLEN
-           && seq_before(ppp->minseq, ppp->mrq.next->sequence))
-               ppp->minseq = ppp->mrq.next->sequence;
+       if (skb_queue_len(&ppp->mrq) >= PPP_MP_MAX_QLEN) {
+               struct sk_buff *skb = skb_peek(&ppp->mrq);
+               if (seq_before(ppp->minseq, skb->sequence))
+                       ppp->minseq = skb->sequence;
+       }
 
        /* Pull completed packets off the queue and receive them. */
        while ((skb = ppp_mp_reconstruct(ppp)))
@@ -1861,10 +1863,11 @@ ppp_mp_insert(struct ppp *ppp, struct sk_buff *skb)
 
        /* N.B. we don't need to lock the list lock because we have the
           ppp unit receive-side lock. */
-       for (p = list->next; p != (struct sk_buff *)list; p = p->next)
+       skb_queue_walk(list, p) {
                if (seq_before(seq, p->sequence))
                        break;
-       __skb_insert(skb, p->prev, p, list);
+       }
+       __skb_queue_before(list, p, skb);
 }
 
 /*
@@ -2124,13 +2127,9 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
            || ccp_option[1] < 2 || ccp_option[1] > data.length)
                goto out;
 
-       cp = find_compressor(ccp_option[0]);
-#ifdef CONFIG_KMOD
-       if (!cp) {
-               request_module("ppp-compress-%d", ccp_option[0]);
-               cp = find_compressor(ccp_option[0]);
-       }
-#endif /* CONFIG_KMOD */
+       cp = try_then_request_module(
+               find_compressor(ccp_option[0]),
+               "ppp-compress-%d", ccp_option[0]);
        if (!cp)
                goto out;