Author: Bhumika Goyal <bhumirks@gmail.com> Remove typedefs from structures stt_timer_t and lst_ping_data_t as typedef for a structure type is not preferred. The suffix ‘_t’ and the typedefs are removed using coccinelle. Script 1: //Drop typedefs and ‘_t’ @r1@ type T; @@ typedef struct { … } T; @script:python c1@ T2; T
Category: Coccinelle
Mar 02 2016
staging: gs_fpgaboot: drop wrapper function ‘finish_driver’
Author: Eva Rachel Retuya <eraretuya@gmail.com> Remove the function ‘finish_driver’ since a direct call to platform_device_unregister() is intuitive enough to signify the original intention of the function being removed. Coccinelle semantic patch used to detect this: @@ identifier wrapper, func; type T; @@ *T wrapper(…) { ( return func(…); | func(…); ) } Signed-off-by: Eva Rachel …
Mar 01 2016
Staging: rtl8192u: Replace random_ether_addr with eth_random_addr
Author: Bhumika Goyal <bhumirks@gmail.com> The macro random_ether_addr is calling the function eth_random_addr. Therefore, the call to random_ether_addr can be replaced with eth_random_addr. Remove the wrapper function ieee80211_randomize_cell and replace its call with eth_random_addr as it is wrapping random_ether_addr. Done using coccinelle: @@ expression addr; @@ – random_ether_addr(addr); + eth_random_addr(addr); Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman …
Mar 01 2016
Staging: gdm724x: Replace random_ether_addr with eth_random_addr
Author: Bhumika Goyal <bhumirks@gmail.com> The macro random_ether_addr is calling the function eth_random_addr. Therefore, the call to random_ether_addr can be replaced with eth_random_addr. Done using coccinelle: @@ expression addr; @@ – random_ether_addr(addr); + eth_random_addr(addr); Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/gdm724x/gdm_lte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff –git a/drivers/staging/gdm724x/gdm_lte.c …
Mar 01 2016
Staging: rtl8192u: Replace memset with eth_broadcast_addr
Author: Bhumika Goyal <bhumirks@gmail.com> Use eth_broadcast_addr to assign the broadcast address to the given address array instead of memset when the second argument is a broacast address 0xff. ETH_ALEN is a macro with value 6, so 6 is treated as ETH_ALEN if it is the third argument of memset. Done using coccinelle. @@ expression e; …
Mar 01 2016
iommu/mediatek: Fix handling of of_count_phandle_with_args result
Author: Andrzej Hajda <a.hajda@samsung.com> The function can return negative value so it should be assigned to signed variable. The patch changes also type of related i variable to make code more compact and coherent. The problem has been detected using patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci. Signed-off-by: Andrzej Hajda Signed-off-by: Joerg Roedel — drivers/iommu/mtk_iommu.c | 3 +– 1 file …
Feb 28 2016
staging: rtl8188eu: os_dep: Remove NULL test before vfree
Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> vfree frees the virtually continuous memory area starting at addr. If addr is NULL, no operation is performed. So NULL test is not needed before vfree. This was done using Coccinelle: @@ expression x; @@ -if (x != NULL) vfree(x); @@ expression x; @@ -if (x != NULL) { vfree(x); x …
Feb 28 2016
staging: rtl8188eu: core: Remove NULL test before vfree
Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> vfree frees the virtually continuous memory area starting at addr. If addr is NULL, no operation is performed. So NULL test is not needed before vfree. This was done using Coccinelle: @@ expression x; @@ -if (x != NULL) vfree(x); @@ expression x; @@ -if (x != NULL) { vfree(x); x …
Feb 28 2016
staging: rts5208: Remove NULL test before vfree
Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> vfree frees the virtually continuous memory area starting at addr. If addr is NULL, no operation is performed. So NULL test is not needed before vfree. This was done using Coccinelle: @@ expression x; @@ -if (x != NULL) vfree(x); @@ expression x; @@ -if (x != NULL) { vfree(x); x …
Feb 28 2016
Staging: lustre: Remove print statement on function failure
Author: Bhumika Goyal <bhumirks@gmail.com> The memory allocation functions generates a call stack containing all the context information on failure, so print statements can be removed on failure of these functions. Also remove unwanted {} around if block after removal of these statements. Done using coccinelle: @@ expression e,e1,e2; identifier x; @@ e=\(kmalloc\|kmalloc_array\|kzalloc\| devm_kzalloc\)(…); …when!=e=e1 if(!e) …