[NET]: cleanup extra semicolons
[powerpc.git] / net / sched / sch_ingress.c
index c3242f7..f8b9f1c 100644 (file)
@@ -1,4 +1,4 @@
-/* net/sched/sch_ingress.c - Ingress qdisc 
+/* net/sched/sch_ingress.c - Ingress qdisc
  *              This program is free software; you can redistribute it and/or
  *              modify it under the terms of the GNU General Public License
  *              as published by the Free Software Foundation; either version
@@ -16,6 +16,7 @@
 #include <linux/netfilter_ipv6.h>
 #include <linux/netfilter.h>
 #include <linux/smp.h>
+#include <net/netlink.h>
 #include <net/pkt_sched.h>
 #include <asm/byteorder.h>
 #include <asm/uaccess.h>
@@ -47,7 +48,7 @@
 */
 #ifndef CONFIG_NET_CLS_ACT
 #ifdef CONFIG_NETFILTER
-static int nf_registered; 
+static int nf_registered;
 #endif
 #endif
 
@@ -70,7 +71,7 @@ static int ingress_graft(struct Qdisc *sch,unsigned long arg,
        DPRINTK("ingress_graft(sch %p,[qdisc %p],new %p,old %p)\n",
                sch, p, new, old);
        DPRINTK("\n ingress_graft: You cannot add qdiscs to classes");
-        return 1;
+       return 1;
 }
 
 
@@ -162,17 +163,17 @@ static int ingress_enqueue(struct sk_buff *skb,struct Qdisc *sch)
                case TC_ACT_QUEUED:
                        result = TC_ACT_STOLEN;
                        break;
-               case TC_ACT_RECLASSIFY: 
+               case TC_ACT_RECLASSIFY:
                case TC_ACT_OK:
                case TC_ACT_UNSPEC:
                default:
                        skb->tc_index = TC_H_MIN(res.classid);
                        result = TC_ACT_OK;
                        break;
-       };
+       }
 /* backward compat */
 #else
-#ifdef CONFIG_NET_CLS_POLICE  
+#ifdef CONFIG_NET_CLS_POLICE
        switch (result) {
                case TC_POLICE_SHOT:
                result = NF_DROP;
@@ -186,7 +187,7 @@ static int ingress_enqueue(struct sk_buff *skb,struct Qdisc *sch)
                sch->bstats.bytes += skb->len;
                result = NF_ACCEPT;
                break;
-       };
+       }
 
 #else
        D2PRINTK("Overriding result to ACCEPT\n");
@@ -232,14 +233,14 @@ static unsigned int ingress_drop(struct Qdisc *sch)
 #ifdef CONFIG_NETFILTER
 static unsigned int
 ing_hook(unsigned int hook, struct sk_buff **pskb,
-                             const struct net_device *indev,
-                             const struct net_device *outdev,
-                            int (*okfn)(struct sk_buff *))
+                            const struct net_device *indev,
+                            const struct net_device *outdev,
+                            int (*okfn)(struct sk_buff *))
 {
-       
+
        struct Qdisc *q;
        struct sk_buff *skb = *pskb;
-        struct net_device *dev = skb->dev;
+       struct net_device *dev = skb->dev;
        int fwres=NF_ACCEPT;
 
        DPRINTK("ing_hook: skb %s dev=%s len=%u\n",
@@ -247,18 +248,13 @@ ing_hook(unsigned int hook, struct sk_buff **pskb,
                skb->dev ? (*pskb)->dev->name : "(no dev)",
                skb->len);
 
-/* 
-revisit later: Use a private since lock dev->queue_lock is also
-used on the egress (might slow things for an iota)
-*/
-
        if (dev->qdisc_ingress) {
-               spin_lock(&dev->queue_lock);
+               spin_lock(&dev->ingress_lock);
                if ((q = dev->qdisc_ingress) != NULL)
                        fwres = q->enqueue(skb, q);
-               spin_unlock(&dev->queue_lock);
-        }
-                       
+               spin_unlock(&dev->ingress_lock);
+       }
+
        return fwres;
 }
 
@@ -296,7 +292,7 @@ static int ingress_init(struct Qdisc *sch,struct rtattr *opt)
        printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
 #endif
 #endif
-                                                                                
+
 #ifndef CONFIG_NET_CLS_ACT
 #ifdef CONFIG_NETFILTER
        if (!nf_registered) {
@@ -345,14 +341,9 @@ static void ingress_reset(struct Qdisc *sch)
 static void ingress_destroy(struct Qdisc *sch)
 {
        struct ingress_qdisc_data *p = PRIV(sch);
-       struct tcf_proto *tp;
 
        DPRINTK("ingress_destroy(sch %p,[qdisc %p])\n", sch, p);
-       while (p->filter_list) {
-               tp = p->filter_list;
-               p->filter_list = tp->next;
-               tcf_destroy(tp);
-       }
+       tcf_destroy_chain(p->filter_list);
 #if 0
 /* for future use */
        qdisc_destroy(p->q);
@@ -362,16 +353,16 @@ static void ingress_destroy(struct Qdisc *sch)
 
 static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-       unsigned char *b = skb->tail;
+       unsigned char *b = skb_tail_pointer(skb);
        struct rtattr *rta;
 
        rta = (struct rtattr *) b;
        RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
-       rta->rta_len = skb->tail - b;
+       rta->rta_len = skb_tail_pointer(skb) - b;
        return skb->len;
 
 rtattr_failure:
-       skb_trim(skb, b - skb->data);
+       nlmsg_trim(skb, b);
        return -1;
 }
 
@@ -417,7 +408,7 @@ static int __init ingress_module_init(void)
 
        return ret;
 }
-static void __exit ingress_module_exit(void) 
+static void __exit ingress_module_exit(void)
 {
        unregister_qdisc(&ingress_qdisc_ops);
 #ifndef CONFIG_NET_CLS_ACT