Author: Markus Elfring <elfring@users.sourceforge.net> This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the regmap_write() function failed. 2. Delete the jump label “err” then. 3. Return zero as a constant at the end. Signed-off-by: Markus Elfring Signed-off-by: Mauro Carvalho Chehab — drivers/media/tuners/m88rs6000t.c | 11 +++++—— 1 …
Category: Linux
Dec 27 2015
surface pro 4: fix compare_const_fl.cocci warnings
Author: Julia Lawall <julia.lawall@lip6.fr> Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci CC: Weng Xuetian Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall Signed-off-by: Darren Hart — drivers/platform/x86/surfacepro3_button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff –git a/drivers/platform/x86/surfacepro3_button.c b/drivers/platform/x86/surfacepro3_button.c index b9c38f6..700e0fa 100644 — a/drivers/platform/x86/surfacepro3_button.c +++ b/drivers/platform/x86/surfacepro3_button.c @@ -111,7 +111,7 @@ …
Dec 27 2015
qlcnic: constify qlcnic_dcb_ops structures
Author: Julia Lawall <julia.lawall@lip6.fr> The qlcnic_dcb_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c | 4 ++– drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff –git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c index a72bcdd..4b76c69 100644 — a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c +++ …
Dec 27 2015
usb: renesas_usbhs: constify usbhs_pkt_handle structures
Author: Julia Lawall <Julia.Lawall@lip6.fr> The usbhs_pkt_handle structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman — drivers/usb/renesas_usbhs/fifo.c | 20 ++++++++++———- drivers/usb/renesas_usbhs/fifo.h | 20 ++++++++++———- drivers/usb/renesas_usbhs/pipe.h | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff –git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c …
Dec 27 2015
[media] si2165: Refactoring for si2165_writereg_mask8()
Author: Markus Elfring <elfring@users.sourceforge.net> This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the si2165_readreg8() function failed. 2. Reduce the scope for the local variables “ret” and “tmp” to one branch of an if statement. 3. Delete the jump label “err” then. 4. Return the value …
Dec 26 2015
USB: usbmon: remove assignment from IS_ERR argument
Author: Julia Lawall <Julia.Lawall@lip6.fr> The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2; statement S1,S2; @@ +e1 = e2; if (IS_ERR( e1 – = e2 )) S1 else S2 // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/usb/mon/mon_text.c | 6 ++++– 1 file changed, 4 insertions(+), 2 deletions(-) …
Dec 26 2015
drivers: net: cpsw: fix error return code
Author: Julia Lawall <julia.lawall@lip6.fr> Propagate the return value of platform_get_irq on failure. A simplified version of the semantic match that finds the two cases where no error code is returned at all is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } …
Dec 24 2015
ASoC: rsnd: fix usrcnt decrementing bug
Author: Andrzej Hajda <a.hajda@samsung.com> Field usrcnt is unsigned so it cannot be lesser than zero. The patch fixes the check, moves it to the beginning of the function and changes return value to -EIO in case of usercnt error. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda …
Dec 23 2015
powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures
Author: Julia Lawall <Julia.Lawall@lip6.fr> The powercap_zone_ops and powercap_zone_constraint_ops structures are never modified, so declare them as const. Most of the actual changes adjust indentation to accomodate the const keyword. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Rafael J. Wysocki — drivers/powercap/intel_rapl.c | 4 ++– drivers/powercap/powercap_sys.c | 18 +++++++++——— include/linux/powercap.h | 4 ++– …
Dec 23 2015
mac802154: constify ieee802154_llsec_ops structure
Author: Julia Lawall <Julia.Lawall@lip6.fr> The ieee802154_llsec_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Alexander Aring Signed-off-by: Marcel Holtmann — include/net/ieee802154_netdev.h | 2 +- net/mac802154/mac_cmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff –git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index a62a051..c4b3160 100644 — …