Category: Linux

net: ipv6: fix error return code

Author: Julia Lawall <Julia.Lawall@lip6.fr> Initialize return variable before exiting on an error path. The initial initialization of the return variable is also dropped, because that value is never used. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return …

Continue reading

ipvs: fix error return code

Author: Julia Lawall <Julia.Lawall@lip6.fr> Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret …

Continue reading

USB: cp210x: remove useless set memory to zero use memset()

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The memory return by kzalloc() or kmem_cache_zalloc() has already be set to zero, so remove useless memset(0). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Greg Kroah-Hartman — drivers/usb/serial/cp210x.c | 1 – 1 file changed, 1 deletion(-)   diff –git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index …

Continue reading

dmaengine: use kmem_cache_zalloc instead of kmem_cache_alloc/memset

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Vinod Koul — drivers/dma/ioat/dma_v2.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c index 8689576..b9d6678 100644 — a/drivers/dma/ioat/dma_v2.c +++ b/drivers/dma/ioat/dma_v2.c @@ -434,12 …

Continue reading

xen/blkback: use kmem_cache_zalloc instead of kmem_cache_alloc/memset

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Konrad Rzeszutek Wilk — drivers/block/xen-blkback/xenbus.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index d0fed55..f58434c 100644 — a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ …

Continue reading

openvswitch: using kfree_rcu() to simplify the code

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The callback function of call_rcu() just calls a kfree(), so we can use kfree_rcu() instead of call_rcu() + callback function. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Acked-by: Jesse Gross Signed-off-by: David S. Miller — net/openvswitch/flow.c | 10 +——— 1 file changed, 1 …

Continue reading

watchdog: sp805_wdt.c: use clk_prepare_enable and clk_disable_unprepare

Author: Julia Lawall <Julia.Lawall@lip6.fr> Clk_prepare_enable and clk_disable_unprepare combine clk_prepare and clk_enable, and clk_disable and clk_unprepare. They make the code more concise, and ensure that clk_unprepare is called when clk_enable fails. A simplified version of the semantic patch that introduces calls to these functions is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ – clk_prepare(e); – …

Continue reading

drivers/tty/serial/amba-pl0{10,11}.c: use clk_prepare_enable and clk_disable_unprepare

Author: Julia Lawall <Julia.Lawall@lip6.fr> Clk_prepare_enable and clk_disable_unprepare combine clk_prepare and clk_enable, and clk_disable and clk_unprepare. The9 make the code more concise, and ensure that clk_unprepare is called when clk_enable fails. A simplified version of the semantic patch that introduces calls to these functions is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ – clk_prepare(e); – …

Continue reading

mmc: mmci: use clk_prepare_enable and clk_disable_unprepare

Author: Julia Lawall <Julia.Lawall@lip6.fr> clk_prepare_enable and clk_disable_unprepare combine clk_prepare and clk_enable, and clk_disable and clk_unprepare. They make the code more concise, and ensure that clk_unprepare is called when clk_enable fails. A simplified version of the semantic patch that introduces calls to these functions is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ – clk_prepare(e); – …

Continue reading

drivers/gpio/gpio-pxa.c: use clk_prepare_enable and clk_disable_unprepare

Author: Julia Lawall <Julia.Lawall@lip6.fr> Clk_prepare_enable and clk_disable_unprepare combine clk_prepare and clk_enable, and clk_disable and clk_unprepare. They make the code more concise, and ensure that clk_unprepare is called when clk_enable fails. A simplified version of the semantic patch that introduces calls to these functions is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ – clk_prepare(e); – …

Continue reading