]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/sched/cls_basic.c
[PATCH] remove many unneeded #includes of sched.h
[net-next-2.6.git] / net / sched / cls_basic.c
index dfb300bb6baa067963a5e0e1e160087ae69d291d..fad08e521c24f91456590ac4cb6988776f80171b 100644 (file)
@@ -9,11 +9,9 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -99,7 +97,7 @@ static void basic_destroy(struct tcf_proto *tp)
 {
        struct basic_head *head = (struct basic_head *) xchg(&tp->root, NULL);
        struct basic_filter *f, *n;
-       
+
        list_for_each_entry_safe(f, n, &head->flist, link) {
                list_del(&f->link);
                basic_delete_filter(tp, f);
@@ -158,7 +156,7 @@ errout:
 }
 
 static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
-                       struct rtattr **tca, unsigned long *arg)
+                       struct rtattr **tca, unsigned long *arg)
 {
        int err = -EINVAL;
        struct basic_head *head = (struct basic_head *) tp->root;
@@ -179,25 +177,23 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
 
        err = -ENOBUFS;
        if (head == NULL) {
-               head = kmalloc(sizeof(*head), GFP_KERNEL);
+               head = kzalloc(sizeof(*head), GFP_KERNEL);
                if (head == NULL)
                        goto errout;
 
-               memset(head, 0, sizeof(*head));
                INIT_LIST_HEAD(&head->flist);
                tp->root = head;
        }
 
-       f = kmalloc(sizeof(*f), GFP_KERNEL);
+       f = kzalloc(sizeof(*f), GFP_KERNEL);
        if (f == NULL)
                goto errout;
-       memset(f, 0, sizeof(*f));
 
        err = -EINVAL;
        if (handle)
                f->handle = handle;
        else {
-               int i = 0x80000000;
+               unsigned int i = 0x80000000;
                do {
                        if (++head->hgenerator == 0x7FFFFFFF)
                                head->hgenerator = 1;
@@ -295,7 +291,7 @@ static int __init init_basic(void)
        return register_tcf_proto_ops(&cls_basic_ops);
 }
 
-static void __exit exit_basic(void) 
+static void __exit exit_basic(void)
 {
        unregister_tcf_proto_ops(&cls_basic_ops);
 }