]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/slhc.c
[PATCH] pcnet32: NAPI implementation
[linux-2.6-omap-h63xx.git] / drivers / net / slhc.c
index 3a1b7131681cd5fa5c9313cdde005d0b0faa76fa..9a540e2092b9a658f7b6ba6234e3675bd87d68aa 100644 (file)
@@ -94,27 +94,23 @@ slhc_init(int rslots, int tslots)
        register struct cstate *ts;
        struct slcompress *comp;
 
-       comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
-                                           GFP_KERNEL);
+       comp = kzalloc(sizeof(struct slcompress), GFP_KERNEL);
        if (! comp)
                goto out_fail;
-       memset(comp, 0, sizeof(struct slcompress));
 
        if ( rslots > 0  &&  rslots < 256 ) {
                size_t rsize = rslots * sizeof(struct cstate);
-               comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL);
+               comp->rstate = kzalloc(rsize, GFP_KERNEL);
                if (! comp->rstate)
                        goto out_free;
-               memset(comp->rstate, 0, rsize);
                comp->rslot_limit = rslots - 1;
        }
 
        if ( tslots > 0  &&  tslots < 256 ) {
                size_t tsize = tslots * sizeof(struct cstate);
-               comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL);
+               comp->tstate = kzalloc(tsize, GFP_KERNEL);
                if (! comp->tstate)
                        goto out_free2;
-               memset(comp->tstate, 0, tsize);
                comp->tslot_limit = tslots - 1;
        }
 
@@ -141,9 +137,9 @@ slhc_init(int rslots, int tslots)
        return comp;
 
 out_free2:
-       kfree((unsigned char *)comp->rstate);
+       kfree(comp->rstate);
 out_free:
-       kfree((unsigned char *)comp);
+       kfree(comp);
 out_fail:
        return NULL;
 }
@@ -700,20 +696,6 @@ EXPORT_SYMBOL(slhc_compress);
 EXPORT_SYMBOL(slhc_uncompress);
 EXPORT_SYMBOL(slhc_toss);
 
-#ifdef MODULE
-
-int init_module(void)
-{
-       printk(KERN_INFO "CSLIP: code copyright 1989 Regents of the University of California\n");
-       return 0;
-}
-
-void cleanup_module(void)
-{
-       return;
-}
-
-#endif /* MODULE */
 #else /* CONFIG_INET */