Category: Linux

drm/nouveau/fuse/gm107: simplify the return logic

Author: Martin Peres <martin.peres@free.fr> Spotted by coccinelle: drivers/gpu/drm/nouveau/core/subdev/fuse/gm107.c:50:5-8: WARNING: end returns can be simpified Signed-off-by: Martin Peres Reviewed-by: Tobias Klausmann Signed-off-by: Ben Skeggs — drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-)   diff –git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c index ba19158..0b256aa 100644 — a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c @@ -45,10 +45,8 @@ gm107_fuse_ctor(struct nvkm_object *parent, struct …

Continue reading

mmc: sdhci: host: fix odd_ptr_err.cocci warnings

Author: Wu Fengguang <fengguang.wu@intel.com> drivers/mmc/host/sdhci_f_sdh30.c:143:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 144 PTR_ERR should access the value just tested by IS_ERR Semantic patch information: There can be false positives in the patch case, where it is the call IS_ERR that is wrong. Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Vincent Yang Signed-off-by: Fengguang Wu Signed-off-by: Ulf Hansson …

Continue reading

power: max77693: fix platform_no_drv_owner.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/power/max77693_charger.c:747:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Krzysztof Kozlowski Signed-off-by: Fengguang Wu Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel — drivers/power/max77693_charger.c | 1 – 1 file changed, 1 deletion(-)   diff …

Continue reading

power: max77693: fix simple_return.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/power/max77693_charger.c:615:1-4: WARNING: end returns can be simpified Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Krzysztof Kozlowski Signed-off-by: Fengguang Wu Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sebastian Reichel — drivers/power/max77693_charger.c | 6 +—– 1 file changed, 1 insertion(+), 5 deletions(-)   diff –git a/drivers/power/max77693_charger.c …

Continue reading

brcmfmac: Use put_unaligned_le32

Author: Vaishali Thakkar <vthakkar1994@gmail.com> This patch introduces the use of function put_unaligned_le32. This is done using Coccinelle and semantic patch used is as follows: @a@ typedef u32, __le32, uint32_t; {u32,__le32,uint32_t} e32; identifier tmp; expression ptr; expression y,e; type T; type T; @@ – tmp = cpu_to_le32(y); ? tmp = e @@ type T; identifier a.tmp; …

Continue reading

IB/qib: Replace rcu_assign_pointer() with RCU_INIT_POINTER() in qib_keys.c

Author: Andreea-Cristina Bernat <bernat.ada@gmail.com> The uses of “rcu_assign_pointer()” are NULLing out the pointers. According to RCU_INIT_POINTER()’s block comment: “1. This use of RCU_INIT_POINTER() is NULLing out the pointer” it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. The following Coccinelle semantic patch was used: @@ @@ – rcu_assign_pointer + …

Continue reading

IB/qib: Replace rcu_assign_pointer() with RCU_INIT_POINTER() in qib_qp.c

Author: Andreea-Cristina Bernat <bernat.ada@gmail.com> According to RCU_INIT_POINTER()’s block comment 3.a, it can be used if “1. This use of RCU_INIT_POINTER() is NULLing out the pointer” it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. “3. The referenced data structure has already been exposed to readers either at compile time …

Continue reading

s390/net: Delete useless checks before function calls

Author: Markus Elfring <elfring@users.sourceforge.net> The function debug_unregister() tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Ursula Braun Signed-off-by: David S. Miller — drivers/s390/net/claw.c | 6 ++—- drivers/s390/net/lcs.c | 6 ++—- drivers/s390/net/netiucv.c …

Continue reading

can: dev: fix semicolon.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com> drivers/net/can/dev.c:294:2-3: Unneeded semicolon Removes unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Cc: Andri Yngvason Signed-off-by: Fengguang Wu Signed-off-by: Marc Kleine-Budde — drivers/net/can/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index e54dbc1a..6ac02c8 100644 — a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -293,7 +293,7 @@ static void can_update_state_error_stats(struct net_device …

Continue reading

drm/i915: Rename struct intel_crtc_config to intel_crtc_state

Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> The objective is to make this structure usable with the atomic helpers, so let’s start with the rename. Patch generated with coccinelle: @@ @@ -struct intel_crtc_config { +struct intel_crtc_state { … } @@ @@ -struct intel_crtc_config +struct intel_crtc_state v2: Completely generate the patch with cocci. (Ander) Signed-off-by: Ander Conselvan …

Continue reading