Catégorie : Coccinelle

Orangefs: fix ifnullfree.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> fs/orangefs/orangefs-debugfs.c:130:2-26: 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 …

Lire la suite

staging: media: omap1: Replace clk_get with devm_clk_get

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> devm_clk_get allocated resources get released when a driver detaches. Replace clk_get with devm_clk_get and remove corresponding data releasing function clk_put from probe and remove functions of a platform device. Also remove an unnecessary label. This change was made with the help of the following Coccinelle semantic patch: @platform@ identifier p, …

Lire la suite

staging: rtl8712: mlme_linux: Clean up tests if NULL returned on failure

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Some functions like kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(…); … – e == NULL + !e Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8712/mlme_linux.c | 2 +- 1 file changed, …

Lire la suite

staging: rtl8188eu: rtw_cmd: Clean up tests if NULL returned on failure

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(…); … – e == NULL + !e Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_cmd.c | 44 ++++++++++++++++—————- 1 file changed, …

Lire la suite

staging: rtl8188eu: rtw_mlme_ext: Clean up tests if NULL returned on failure

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Some functions like kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(…); … – e == NULL + !e Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 26 +++++++++++++————- 1 file changed, …

Lire la suite

staging: rtl8188eu: core: rtw_mlme: Clean up tests if NULL returned on failure

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(…); … – e == NULL + !e Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_mlme.c | 8 ++++—- 1 file changed, …

Lire la suite

staging: rtl8188eu: os_dep: usb_intf: Clean up tests if NULL returned on failure

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(…); … – e == NULL + !e Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +- 1 file changed, …

Lire la suite

staging: rtl8188eu: os_dep: ioctl_linux: Clean up tests if NULL returned on failure

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(…); … – e == NULL + !e Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 8 ++++—- 1 file changed, …

Lire la suite

debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage

Author: Nicolai Stange <nicstange@gmail.com> In order to protect against file removal races, debugfs files created via debugfs_create_file() now get wrapped by a struct file_operations at their opening. If the original struct file_operations are known to be safe against removal races by themselves already, the proxy creation may be bypassed by creating the files through debugfs_create_file_unsafe(). …

Lire la suite

staging: comedi: amplc_pci230: Convert macro GAT_CONFIG to static inline function

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Convert macro GAT_CONFIG to static inline function as static inline functions are preferred over macros. This change is possible since the arguments at all call sites have the same type. This was done using Coccinelle: @r@ expression e; @@ – #define GAT_CONFIG(chan, src) e + static inline unsigned int pci230_gat_config(unsigned int …

Lire la suite