Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-drm-fsl-dcu.git] / net / sched / cls_basic.c
index 61507f006b114e350fb5dee3febb3961ea965b9e..ea13c2c5b0618a3fff9a26eeec73d3c84f6159e4 100644 (file)
@@ -98,7 +98,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);
@@ -157,7 +157,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;
@@ -178,25 +178,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;
@@ -294,7 +292,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);
 }