Catégorie : Linux

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 …

Lire la suite

[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 | …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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, …

Lire la suite

ext4: use swap() in mext_page_double_lock()

Author: Fabian Frederick <fabf@skynet.be> Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick Signed-off-by: Theodore Ts’o — fs/ext4/move_extent.c | 9 +++—— 1 file changed, 3 insertions(+), 6 deletions(-)   diff –git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 370420b..8c04afb 100644 — a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -166,12 +166,9 @@ mext_page_double_lock(struct inode *inode1, struct inode …

Lire la suite

ext4: use swap() in memswap()

Author: Fabian Frederick <fabf@skynet.be> Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick Signed-off-by: Theodore Ts’o — fs/ext4/ioctl.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-)   diff –git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 7ce8582..cb84512 100644 — a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -31,14 +31,11 @@ static void memswap(void *a, void …

Lire la suite

sound: oss/sb_audio: use swap() in sb_audio_close()

Author: Fabian Frederick <fabf@skynet.be> Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick Signed-off-by: Takashi Iwai — sound/oss/sb_audio.c | 8 ++—— 1 file changed, 2 insertions(+), 6 deletions(-)   diff –git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c index 048439a..dc91072 100644 — a/sound/oss/sb_audio.c +++ b/sound/oss/sb_audio.c @@ -102,12 +102,8 @@ void sb_audio_close(int dev) if(devc->duplex && …

Lire la suite

ALSA: gus: use swap() in snd_ics_put_double()

Author: Fabian Frederick <fabf@skynet.be> Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick Signed-off-by: Takashi Iwai — sound/isa/gus/gus_mixer.c | 9 +++—— 1 file changed, 3 insertions(+), 6 deletions(-)   diff –git a/sound/isa/gus/gus_mixer.c b/sound/isa/gus/gus_mixer.c index 0dd4341..3b5d9a7 100644 — a/sound/isa/gus/gus_mixer.c +++ b/sound/isa/gus/gus_mixer.c @@ -109,7 +109,7 @@ static int snd_ics_put_double(struct snd_kcontrol *kcontrol, …

Lire la suite