Category: Linux

staging: lustre: osc: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@lip6.fr> Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: ptlrpc: Use kzalloc and kfree

Author: Julia Lawall <Julia.Lawall@lip6.fr> Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // @@ expression ptr,size; @@ – OBD_ALLOC(ptr,size) + ptr = kzalloc(size, GFP_NOFS) @@ expression ptr, size; @@ – OBD_FREE(ptr, size); + kfree(ptr); …

Continue reading

staging: lustre: fix ifnullfree.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/staging/lustre/lustre/lov/lov_obd.c:574:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning “kfree(NULL) is safe this check is probably not required” and kfreeaddr.cocci …

Continue reading

staging: lustre: fix ifnullfree.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/staging/lustre/lustre/lov/lov_request.c:74:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning “kfree(NULL) is safe this check is probably not required” and kfreeaddr.cocci …

Continue reading

staging: lustre: llite: fix ifnullfree.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/staging/lustre/lustre/llite/dir.c:1440:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning “kfree(NULL) is safe this check is probably not required” and kfreeaddr.cocci …

Continue reading

staging: lustre: llite: fix ifnullfree.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/staging/lustre/lustre/llite/llite_lib.c:989:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. drivers/staging/lustre/lustre/llite/llite_lib.c:991:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing …

Continue reading

i2o: fix simple_return.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/staging/i2o/iop.c:777:1-3: WARNING: end returns can be simpified Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Alan Cox Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman — drivers/staging/i2o/iop.c | 6 +—– 1 file changed, 1 insertion(+), 5 deletions(-)   diff –git a/drivers/staging/i2o/iop.c b/drivers/staging/i2o/iop.c index c88df55..3c23790 …

Continue reading

USB: xusbatm.c: move assignment out of if () block

Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org> We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Felipe Balbi — drivers/usb/atm/xusbatm.c | 6 ++++– 1 file changed, 4 insertions(+), 2 deletions(-)   diff –git a/drivers/usb/atm/xusbatm.c b/drivers/usb/atm/xusbatm.c index b3b1bb7..a87597f 100644 …

Continue reading

USB: uss720.c: move assignment out of if () block

Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org> We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. CC: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman Reviewed-by: Felipe Balbi — drivers/usb/misc/uss720.c | 6 ++++– 1 file changed, 4 insertions(+), 2 deletions(-)   diff –git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c …

Continue reading

USB: usblp.c: move assignment out of if () block

Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org> We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. Acked-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman Reviewed-by: Felipe Balbi — drivers/usb/class/usblp.c | 15 ++++++++++—– 1 file changed, 10 insertions(+), 5 deletions(-)   diff –git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c …

Continue reading