Category: Linux

Staging: iio: magnetometer: remove exceptional & on function name

Author: Bhumika Goyal <bhumirks@gmail.com> In this file,function names are otherwise used as pointers without &. Found using coccinelle. // @r@ identifier f; @@ f(…) { … } @@ identifier r.f; @@ – &f + f // Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/iio/magnetometer/hmc5843_core.c | 6 +++— 1 file changed, 3 insertions(+), 3 deletions(-)   …

Continue reading

Staging: iio: light: remove exceptional & on function name

Author: Bhumika Goyal <bhumirks@gmail.com> In this file,function names are otherwise used as pointers without &. Found using coccinelle. // @r@ identifier f; @@ f(…) { … } @@ identifier r.f; @@ – &f + f // Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/iio/light/isl29028.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   …

Continue reading

Staging: iio: light: remove exceptional & on function name

Author: Bhumika Goyal <bhumirks@gmail.com> In this file,function names are otherwise used as pointers without &. Found using coccinelle. // @r@ identifier f; @@ f(…) { … } @@ identifier r.f; @@ – &f + f // Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/iio/light/isl29018.c | 8 ++++—- 1 file changed, 4 insertions(+), 4 deletions(-)   …

Continue reading

staging: goldfish: goldfish_nand: Return correct error code

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> The return value of devm_kzalloc on failure of allocation of memory should be -ENOMEM and not -1. Found using Coccinelle. A simplified version of the semantic patch used is: // @@ expression *e; @@ e = devm_kzalloc(…); if (e == NULL) { … return – -1 + -ENOMEM ; } …

Continue reading

IB/core: Replace memset with eth_zero_addr

Author: Amitoj Kaur Chawla <amitoj1606@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 used to make this change is as follows: // @eth_zero_addr@ expression e; @@ -memset(e,0x00,ETH_ALEN); +eth_zero_addr(e); // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Doug Ledford — …

Continue reading

staging: comedi: Use ARRAY_SIZE for sizes of arrays

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Use ARRAY_SIZE to calculate the size of an array to make code concise. The semantic patch used can be found here: https://github.com/coccinelle/coccinellery/commit/9cbab452a3a2e18439e8386d6c4a68ee42c3ee2b Signed-off-by: Janani Ravichandran Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/ni_mio_c_common.c | 0 drivers/staging/comedi/drivers/ni_mio_common.c | 7 ++—– 2 files changed, 2 insertions(+), 5 deletions(-)   diff –git a/drivers/staging/comedi/drivers/ni_mio_c_common.c b/drivers/staging/comedi/drivers/ni_mio_c_common.c new file mode …

Continue reading

staging: rtl8723au: Use ARRAY_SIZE macro for sizes of arrays

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Use ARRAY_SIZE to calculate the size of an array to make code concise. The semantic patch used can be found here: https://github.com/coccinelle/coccinellery/commit/9cbab452a3a2e18439e8386d6c4a68ee42c3ee2b Signed-off-by: Janani Ravichandran Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8723au/core/rtw_cmd.c | 3 +– drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 3 +– drivers/staging/rtl8723au/hal/HalHWImg8723A_BB.c | 6 +++— drivers/staging/rtl8723au/hal/HalHWImg8723A_MAC.c | 2 +- 4 files changed, 6 insertions(+), 8 …

Continue reading

pinctrl: mediatek: fix handling return value of mtk_pmx_find_gpio_mode

Author: Andrzej Hajda <a.hajda@samsung.com> The function can return negative values, so its result should be assigned to signed variable. The problem has been detected using coccinelle semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci. Fixes: 59ee9c9 (‘pinctrl: mediatek: Add gpio_request_enable support’) Signed-off-by: Andrzej Hajda Acked-by: Hongzhou Yang Signed-off-by: Linus Walleij — drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- 1 file changed, 1 insertion(+), …

Continue reading

staging: vt6656: replace explicit NULL comparison with ! operator

Author: Alison Schofield <amsfield22@gmail.com> Replace explicit NULL comparison with ! operator to simplify code. Found with Coccinelle: @@ expression e; statement s0, s1; @@ if ( ( + ! e – == NULL || … ) ) s0 else s1 Signed-off-by: Alison Schofield Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/vt6656/main_usb.c | 10 +++++—– drivers/staging/vt6656/usbpipe.c …

Continue reading

staging: wilc1000: remove parentheses on right hand side of assignment

Author: Alison Schofield <amsfield22@gmail.com> Remove the unnecessary parens on right hand side of assignment. Found using Coccinelle: @@ identifier x; expression e1, e2; @@ – x = (e1