fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / ppp_deflate.c
index c51291a..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;
 
@@ -600,7 +598,7 @@ extern void ppp_unregister_compressor (struct compressor *cp);
 /*
  * Procedures exported to if_ppp.c.
  */
-struct compressor ppp_deflate = {
+static struct compressor ppp_deflate = {
        .compress_proto =       CI_DEFLATE,
        .comp_alloc =           z_comp_alloc,
        .comp_free =            z_comp_free,
@@ -618,7 +616,7 @@ struct compressor ppp_deflate = {
        .owner =                THIS_MODULE
 };
 
-struct compressor ppp_deflate_draft = {
+static struct compressor ppp_deflate_draft = {
        .compress_proto =       CI_DEFLATE_DRAFT,
        .comp_alloc =           z_comp_alloc,
        .comp_free =            z_comp_free,
@@ -636,8 +634,8 @@ struct compressor ppp_deflate_draft = {
        .owner =                THIS_MODULE
 };
 
-int __init deflate_init(void)
-{  
+static int __init deflate_init(void)
+{
         int answer = ppp_register_compressor(&ppp_deflate);
         if (answer == 0)
                 printk(KERN_INFO
@@ -645,8 +643,8 @@ int __init deflate_init(void)
        ppp_register_compressor(&ppp_deflate_draft);
         return answer;
 }
-     
-void __exit deflate_cleanup(void)
+
+static void __exit deflate_cleanup(void)
 {
        ppp_unregister_compressor(&ppp_deflate);
        ppp_unregister_compressor(&ppp_deflate_draft);