Author: Julia Lawall <Julia.Lawall@lip6.fr> for_each_matching_node_and_match performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression e1,e2,e; local idexpression np; @@ for_each_matching_node_and_match(np, e1, e2) { … when != of_node_put(np) when != e …
Category: Linux
Oct 22 2015
staging: dgap: add spaces around binary operator ‘|’
Author: Ioana Ciornei <ciorneiioana@gmail.com> This patch adds spaces around binary operator ‘|’. Done with coccinelle semantic patch: @@ identifier x, y, z; @@ ( – x|y|z + x | y | z | – x|y + x | y ) Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman — drivers/staging/dgap/dgap.c | 58 ++++++++++++++++++++++———————– 1 file changed, 29 …
Oct 22 2015
staging: dgap: remove unnecessary brackets
Author: Ioana Ciornei <ciorneiioana@gmail.com> This patch removes unnecessary brackets when dealing with unary operators like ‘&’. Done with coccinelle semantic patch: @@ expression e; @@ ( – &(e) + &e ) Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman — drivers/staging/dgap/dgap.c | 190 ++++++++++++++++++++++———————- 1 file changed, 95 insertions(+), 95 deletions(-) diff –git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index …
Oct 22 2015
staging: dgap: remove unnecessary space after cast
Author: Ioana Ciornei <ciorneiioana@gmail.com> This patch removes unnecessary spaces after the cast. Patch done with coccinelle semantic patch: @rule0@ type t; identifier e; constant c; expression expr; @@ ( – (t) e + (t)e | – (t) c + (t)c | – (t) expr + (t)expr ) Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman — drivers/staging/dgap/dgap.c …
Oct 21 2015
Staging: rtl8192u: Eliminate use of MSECS macro
Author: Shraddha Barke <shraddha.6596@gmail.com> Use msecs_to_jiffies instead of driver specific macro MSECS. This is done using Coccinelle and semantic patch used for this is as follows: @@expression t;@@ – MSECS(t) + msecs_to_jiffies(t) Signed-off-by: Shraddha Barke Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8192u/r8192U_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff –git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c …
Oct 20 2015
staging: comedi: Fix return flow
Author: Cristina Moraru <cristina.moraru09@gmail.com> Simplify function return flow. Issue found with coccinelle. Signed-off-by: Cristina Moraru Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/daqboard2000.c | 8 ++—— 1 file changed, 2 insertions(+), 6 deletions(-) diff –git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c index 611b0a3..57ab668 100644 — a/drivers/staging/comedi/drivers/daqboard2000.c +++ b/drivers/staging/comedi/drivers/daqboard2000.c @@ -713,12 +713,8 @@ static int daqboard2000_auto_attach(struct comedi_device *dev, return result; s …
Oct 20 2015
net: hisilicon: fix ptr_ret.cocci warnings
Author: Wu Fengguang <fengguang.wu@intel.com> drivers/net/ethernet/hisilicon/hns/hnae.c:442:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(…)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci CC: Arnd Bergmann Signed-off-by: Fengguang Wu Signed-off-by: David S. Miller — drivers/net/ethernet/hisilicon/hns/hnae.c | 5 +—- 1 file changed, 1 insertion(+), 4 deletions(-) diff –git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c index 9d3bb83..b364529 100644 — a/drivers/net/ethernet/hisilicon/hns/hnae.c +++ b/drivers/net/ethernet/hisilicon/hns/hnae.c @@ …
Oct 19 2015
rtc: isl1208: Pass the IRQF_ONESHOT flag
Author: Fabio Estevam <fabio.estevam@freescale.com> Since commit 1c6c69525b40eb76de8adf039409722015927dc3 (“genirq: Reject bogus threaded irq requests”) threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. So pass the IRQF_ONESHOT flag in this case. The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci Signed-off-by: Fabio Estevam Signed-off-by: Alexandre Belloni …
Oct 18 2015
stating: gdm724x: remove explicit NULL comparison
Author: Ioana Ciornei <ciorneiioana@gmail.com> This patch converts explicit NULL comparison to its shorter equivalent form. Done with coccinelle semantic patch: @@ expression e; @@ – e == NULL + !e Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman — drivers/staging/gdm724x/gdm_lte.c | 4 ++– drivers/staging/gdm724x/gdm_mux.c | 4 ++– drivers/staging/gdm724x/gdm_tty.c | 2 +- drivers/staging/gdm724x/gdm_usb.c | 16 ++++++++——– drivers/staging/gdm724x/netlink_k.c | …
Oct 17 2015
NFC: delete null dereference
Author: Julia Lawall <Julia.Lawall@lip6.fr> The exit label performs device_unlock(&dev->dev);, which will fail when dev is NULL, and nfc_put_device(dev);, which is not useful when dev is NULL, so just exit the function immediately. Problem found using scripts/coccinelle/null/deref_null.cocci Signed-off-by: Julia Lawall Signed-off-by: Samuel Ortiz — net/nfc/netlink.c | 6 ++—- 1 file changed, 2 insertions(+), 4 deletions(-) …