mfd: Remove redundant spi driver bus initialization

Author: Lars-Peter Clausen <lars@metafoo.de> In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_driver_register() so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // @@ identifier _driver; @@ struct spi_driver _driver = { …

Lire la suite

net: Remove redundant spi driver bus initialization

Author: Lars-Peter Clausen <lars@metafoo.de> In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_driver_register() so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // @@ identifier _driver; @@ struct spi_driver _driver = { …

Lire la suite

net:phy:marvell: remove unnecessary code

Author: Srinivas Kandagatla <srinivas.kandagatla@st.com> Compile tested. remove unnecessary code that matches this coccinelle pattern ret = phy_write(x, y , z) if (ret < 0) return ret; return 0; As phy_write returns error code, we dont need to do not need extra check before returning. Signed-off-by: Srinivas Kandagatla Signed-off-by: David S. Miller --- drivers/net/phy/marvell.c | 18 …

Lire la suite

net:phy:davicom: remove unnecessary code

Author: Srinivas Kandagatla <srinivas.kandagatla@st.com> Compile tested. remove unnecessary code that matches this coccinelle pattern ret = phy_write(x, y , z) if (ret < 0) return ret; return 0; As phy_write returns error code, we dont need to do not need extra check before returning. Signed-off-by: Srinivas Kandagatla Signed-off-by: David S. Miller --- drivers/net/phy/davicom.c | 7 …

Lire la suite

net:phy:bcm63xx: remove unnecessary code

Author: Srinivas Kandagatla <srinivas.kandagatla@st.com> Compile tested. remove unnecessary code that matches this coccinelle pattern ret = phy_write(x, y , z) if (ret < 0) return ret; return 0; As phy_write returns error code, we dont need to do not need extra check before returning. Signed-off-by: Srinivas Kandagatla Signed-off-by: David S. Miller --- drivers/net/phy/bcm63xx.c | 5 …

Lire la suite

MIPS: ath79: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: Gabor Juhos Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3483/ Signed-off-by: Ralf Baechle — arch/mips/ath79/dev-gpio-buttons.c | 4 +— arch/mips/ath79/dev-leds-gpio.c | 4 +— 2 files changed, 2 insertions(+), 6 deletions(-)   diff –git a/arch/mips/ath79/dev-gpio-buttons.c b/arch/mips/ath79/dev-gpio-buttons.c index 4b0168a..366b35f 100644 — a/arch/mips/ath79/dev-gpio-buttons.c +++ …

Lire la suite

mtd: do not use plain 0 as NULL

Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> The first 3 arguments of ‘mtd_device_parse_register()’ are pointers, but many callers pass ‘0’ instead of ‘NULL’. Fix this globally. Thanks to coccinelle for making it easy to do with the following semantic patch: @@ expression mtd, types, parser_data, parts, nr_parts; @@ ( -mtd_device_parse_register(mtd, 0, parser_data, parts, nr_parts) +mtd_device_parse_register(mtd, NULL, parser_data, parts, …

Lire la suite

drivers/atm/solos-pci.c: exchange pci_iounmaps

Author: Julia Lawall <Julia.Lawall@lip6.fr> The calls to pci_iounmap are in the wrong order, as compared to the associated calls to pci_iomap. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,x; statement S,S1; int ret; @@ e = pci_iomap(x,…) … when != pci_iounmap(x,e) if () S …

Lire la suite

PTR_ERR should be called before its argument is cleared.

Author: Julia Lawall <Julia.Lawall@lip6.fr> The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; constant c; @@ *e = c … when != e = e1 when != &e when != true IS_ERR(e) *PTR_ERR(e) // Signed-off-by: Julia Lawall Reported-by: Josh Triplett Signed-off-by: Paul E. McKenney — kernel/rcutorture.c | 5 ++++- …

Lire la suite

drivers/net/ethernet/ti: Move call to PTR_ERR after reassignment

Author: Julia Lawall <Julia.Lawall@lip6.fr> PTR_ERR should be called before its argument is cleared. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; constant c; @@ *e = c … when != e = e1 when != &e when != true IS_ERR(e) *PTR_ERR(e) // Signed-off-by: Julia Lawall Reported-by: Josh Triplett …

Lire la suite