Author's posts
Jun 20 2015
staging: lustre: ldlm: Use !x to check for kzalloc failure
Author: Julia Lawall <Julia.Lawall@lip6.fr> !x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; statement S1, S2; @@ x = kzalloc(…); if ( – x == NULL + !x ) S1 else S2 // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman …
Jun 20 2015
staging: lustre: lclient: Use !x to check for kzalloc failure
Author: Julia Lawall <Julia.Lawall@lip6.fr> !x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; statement S1, S2; @@ x = kzalloc(…); if ( – x == NULL + !x ) S1 else S2 // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman …
Jun 20 2015
staging: lustre: fld: Use !x to check for kzalloc failure
Author: Julia Lawall <Julia.Lawall@lip6.fr> !x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; statement S1, S2; @@ x = kzalloc(…); if ( – x == NULL + !x ) S1 else S2 // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman …
Jun 20 2015
staging: lustre: fid: Use !x to check for kzalloc failure
Author: Julia Lawall <Julia.Lawall@lip6.fr> !x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; statement S1, S2; @@ x = kzalloc(…); if ( – x == NULL + !x ) S1 else S2 // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman …
Jun 20 2015
[media] dvb_core: Replace memset with eth_zero_addr
Author: Vaishali Thakkar <vthakkar1994@gmail.com> Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero. The Coccinelle semantic patch that makes this change is as follows: // @eth_zero_addr@ expression e; @@ -memset(e,0x00,ETH_ALEN); +eth_zero_addr(e); // Signed-off-by: Vaishali Thakkar Signed-off-by: Mauro Carvalho Chehab — drivers/media/dvb-core/dvb_net.c | …
Jun 18 2015
Bluetooth: Use zalloc when possible
Author: Johan Hedberg <johan.hedberg@intel.com> Use zallog for adv_instance allocation instead of kmalloc + memset. This also fixes the following coccinelle warning: >> net/bluetooth/hci_core.c:2693:17-24: WARNING: kzalloc should be used for adv_instance, instead of kmalloc/memset Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann — net/bluetooth/hci_core.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-) diff –git a/net/bluetooth/hci_core.c …
Jun 17 2015
staging:rtl8723au: Fix return statement reported by coccinelle
Author: Prasanna Karthik <mkarthi3@visteon.com> Modified return statement and removed local declaration no longer needed. No Compiler warnings. Signed-off-by: Prasanna Karthik Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-) diff –git a/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c b/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c index 4909835..11d635d 100644 — a/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c @@ -500,7 +500,6 @@ phy_RF6052_Config_ParaFile_Fail: int PHY_RF6052_Config8723A(struct rtw_adapter …
Jun 16 2015
regulator: fix simple_return.cocci warnings
Author: Julia Lawall <julia.lawall@lip6.fr> Simplify a trivial if-return sequence and combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Mark Brown Signed-off-by: Julia Lawall Signed-off-by: Mark Brown — drivers/regulator/qcom_spmi-regulator.c | 6 +—– 1 file changed, 1 insertion(+), 5 deletions(-) diff –git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 162b865..15bba2b 100644 — a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -710,12 +710,8 …
Jun 16 2015
staging:lustre:mdc: Fix return statement reported by coccinelle
Author: Prasanna Karthik <mkarthi3@visteon.com> Modified return statement and removed local declaration no longer needed. No Compiler warnings. Signed-off-by: Prasanna Karthik Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-) diff –git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index c23511f..7f208a6 100644 — a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2090,7 +2090,6 @@ static int mdc_hsm_copytool_send(int len, …
Jun 15 2015
Matching usage of bool variables
In this example we write a semantic patch to match the uses of a variable having a user defined type. This tutorial explains how to name rules. We introduce two metavariable types, namely typedef and idexpression. Here we will be studying the following patch: @find_usage@ typedef bool; idexpression bool id; @@ * id@find_usage@ typedef …