X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fppp_deflate.c;h=72c8d6628f583a041023dfab6a90d7922e101cf8;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=c51291a3c40ac73b0a9a49a125ea9c6cdd2c988e;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index c51291a3c..72c8d6628 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c @@ -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);