Catégorie : Linux

rtc: isl12057: use PTR_ERR_OR_ZERO to fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/rtc/rtc-isl12057.c:278:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(…)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Arnaud Ebalard CC: Jason Cooper Signed-off-by: Fengguang Wu Signed-off-by: Jason Cooper — drivers/rtc/rtc-isl12057.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-)   diff –git a/drivers/rtc/rtc-isl12057.c b/drivers/rtc/rtc-isl12057.c index 7854a65..835b425 100644 — a/drivers/rtc/rtc-isl12057.c +++ …

Lire la suite

caif: delete unnecessary field initialization

Author: Julia Lawall <Julia.Lawall@lip6.fr> On success, the function netdev_alloc_skb initializes the dev field of its result to its first argument, so this doesn’t have to be done in the calling context. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression skb,privn,e; @@ skb = netdev_alloc_skb(privn,…); … when strict ( -skb->dev …

Lire la suite

staging: r8712u: delete unnecessary field initialization

Author: Julia Lawall <Julia.Lawall@lip6.fr> On success, the function netdev_alloc_skb initializes the dev field of its result to its first argument, so this doesn’t have to be done in the calling context. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression skb,privn,e; @@ skb = netdev_alloc_skb(privn,…); … when strict ( -skb->dev …

Lire la suite

staging: fpgaboot: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/staging/gs_fpgaboot/gs_fpgaboot.c:191:2-3: Unneeded semicolon Removes unneeded semicolon. Generated by: coccinelle/misc/semicolon.cocci CC: Insop Song Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman — drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index 31a6741..89bc84d 100644 — a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -188,7 +188,7 @@ static int gs_read_image(struct fpgaimage *fimage) …

Lire la suite

staging: fpgaboot: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/staging/gs_fpgaboot/gs_fpgaboot.c:305:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(…)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Insop Song Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman — drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-)   diff –git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index fee2f61..31a6741 100644 — a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -302,10 …

Lire la suite

cgroup: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> kernel/cgroup.c:2256:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(…)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci Signed-off-by: Fengguang Wu Signed-off-by: Tejun Heo — kernel/cgroup.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-)   diff –git a/kernel/cgroup.c b/kernel/cgroup.c index 750d0e1..15dcae7 100644 — a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -2171,9 +2171,7 @@ static …

Lire la suite

ath10k: release conf_mutex if vdev_start() fails

Author: Kalle Valo <kvalo@qca.qualcomm.com> I modified Michal’s commit c930f744bdb0 (« ath10k: implement channel switching ») to return when vdev_start() fails, but forgot to release conf_mutex. Found by coccinelle: >> drivers/net/wireless/ath/ath10k/mac.c:2745:5-11: preceding lock on line 2663 Signed-off-by: Kalle Valo — drivers/net/wireless/ath/ath10k/mac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)   diff –git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 5c5860e..44b550b …

Lire la suite

net: remove unnecessary return’s

Author: stephen hemminger <stephen@networkplumber.org> One of my pet coding style peeves is the practice of adding extra return; at the end of function. Kill several instances of this in network code. I suppose some coccinelle wizardy could do this automatically. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller — net/batman-adv/gateway_client.c | 2 — net/ceph/osd_client.c | 2 …

Lire la suite

staging/lustre: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/staging/lustre/lustre/llite/dir.c:1416:2-8: Replace memcpy with struct assignment Generated by: coccinelle/misc/memcpy-assign.cocci CC: Peng Tao CC: Andreas Dilger CC: Oleg Drokin CC: Greg Kroah-Hartman Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lustre/llite/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 78ee3b1..fd0dd20e 100644 — a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c …

Lire la suite

fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix

Author: Andrew Morton <akpm@linux-foundation.org> use do{}while – more efficient and it squishes a coccinelle warning Reported-by: Fengguang Wu Cc: Cody P Schafer Cc: Jan Kara Cc: Michel Lespinasse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds — fs/ext3/dir.c | 8 ++++—- 1 file changed, 4 insertions(+), 4 deletions(-)   diff –git a/fs/ext3/dir.c b/fs/ext3/dir.c index a331ad1..e66e480 100644 — …

Lire la suite