IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters
[powerpc.git] / drivers / net / ppp_deflate.c
index 507d632..72c8d66 100644 (file)
@@ -87,8 +87,7 @@ static void z_comp_free(void *arg)
 
        if (state) {
                zlib_deflateEnd(&state->strm);
-               if (state->strm.workspace)
-                       vfree(state->strm.workspace);
+               vfree(state->strm.workspace);
                kfree(state);
        }
 }
@@ -122,7 +121,7 @@ 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 = kmalloc(sizeof(*state),
                                                     GFP_KERNEL);
        if (state == NULL)
                return NULL;
@@ -308,8 +307,7 @@ static void z_decomp_free(void *arg)
 
        if (state) {
                zlib_inflateEnd(&state->strm);
-               if (state->strm.workspace)
-                       kfree(state->strm.workspace);
+               kfree(state->strm.workspace);
                kfree(state);
        }
 }
@@ -343,7 +341,7 @@ 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 = kmalloc(sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                return NULL;
 
@@ -637,7 +635,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
@@ -645,7 +643,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);