]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/ppp_deflate.c
[netdrvr] ibmlana: move away from legacy MCA API
[linux-2.6-omap-h63xx.git] / drivers / net / ppp_deflate.c
index 3872088fdd10cc4dafb1c37bfaea89736d671d6c..eb98b661efbafd03f51996a41f4839eada5b03b8 100644 (file)
@@ -121,12 +121,11 @@ static void *z_comp_alloc(unsigned char *options, int opt_len)
        if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
                return NULL;
 
-       state = (struct ppp_deflate_state *) kmalloc(sizeof(*state),
+       state = kzalloc(sizeof(*state),
                                                     GFP_KERNEL);
        if (state == NULL)
                return NULL;
 
-       memset (state, 0, sizeof (struct ppp_deflate_state));
        state->strm.next_in   = NULL;
        state->w_size         = w_size;
        state->strm.workspace = vmalloc(zlib_deflate_workspacesize());
@@ -341,11 +340,10 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
        if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
                return NULL;
 
-       state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
+       state = kzalloc(sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                return NULL;
 
-       memset (state, 0, sizeof (struct ppp_deflate_state));
        state->w_size         = w_size;
        state->strm.next_out  = NULL;
        state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
@@ -635,7 +633,7 @@ static struct compressor ppp_deflate_draft = {
 };
 
 static int __init deflate_init(void)
-{  
+{
         int answer = ppp_register_compressor(&ppp_deflate);
         if (answer == 0)
                 printk(KERN_INFO
@@ -643,7 +641,7 @@ static int __init deflate_init(void)
        ppp_register_compressor(&ppp_deflate_draft);
         return answer;
 }
-     
+
 static void __exit deflate_cleanup(void)
 {
        ppp_unregister_compressor(&ppp_deflate);