Category: Coccinelle

gpio: xgene: fix type of variable containing error codes

Author: Andrzej Hajda <a.hajda@samsung.com> ret variable can contain error values and is compared with zero. Its type must be signed. The problem has been detected using coccinelle script scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci Signed-off-by: Andrzej Hajda Signed-off-by: Linus Walleij — drivers/gpio/gpio-xgene-sb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c index b993b86..fd81ebc 100644 …

Continue reading

gpio: xgene: fix type of variable containing error codes

Author: Andrzej Hajda <a.hajda@samsung.com> ret variable can contain error values and is compared with zero. Its type must be signed. The problem has been detected using coccinelle script scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci Signed-off-by: Andrzej Hajda Signed-off-by: Linus Walleij — drivers/gpio/gpio-xgene-sb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c index b993b86..fd81ebc 100644 …

Continue reading

ASoC: max9867: fix type of variable containing error codes

Author: Andrzej Hajda <a.hajda@samsung.com> value variable can contain error values and is compared with zero. Its type must be signed. The problem has been detected using coccinelle script scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci Signed-off-by: Andrzej Hajda Reviewed-by: Axel Lin Signed-off-by: Mark Brown — sound/soc/codecs/max9867.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)   diff –git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c …

Continue reading

staging: fbtft: Use kmalloc_array

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Use kmalloc_array instead of kmalloc for arrays to prevent integer overflows. This was done using Coccinelle: @@ expression e1, e2; constant C; type t; @@ ( – kmalloc( + kmalloc_array( e2 – * + , sizeof(e1), C) | – kmalloc( + kmalloc_array( e1 – * + , sizeof(t), C) | – …

Continue reading

staging: rtl8712: Remove unnecessary parantheses

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Removed parantheses on the right hand side of assignments as they are not needed. This was done with Coccinelle: @@ expression a, b; @@ a = – ( b – ) ; Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8712/ieee80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   …

Continue reading

staging: rtl8188eu: Remove unnecessary parantheses

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Removed parantheses on the right hand side of assignments as they are not needed. This was done with Coccinelle: @@ expression a, b; @@ a = – ( b – ) ; Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_ap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   …

Continue reading

staging: rtl8723au: Remove unnecessary parantheses

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Removed parantheses on the right hand side of assignments as they are not needed. This was done with Coccinelle: @@ expression a, b; @@ a = – ( b – ) ; Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   …

Continue reading

staging: rdma: hfi1: Compress return logic

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Simplified function return by merging assignment and return into one line. Found with Coccinelle. @@ expression e; local idexpression ret; @@ – ret = + return e; – return ret; @@ type T; identifier x; @@ – T x; … when != x Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman — drivers/staging/rdma/hfi1/user_pages.c …

Continue reading

staging: most: hdm-usb: Use macro DIV_ROUND_UP

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> The macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( – ((e1) + e2 – 1) / (e2) + DIV_ROUND_UP(e1,e2) | – ((e1) + (e2 – 1))/ (e2) + …

Continue reading

usb: dwc2: Use kmem_cache_free()

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> Here, free memory is allocated using kmem_cache_zalloc. So, use kmem_cache_free instead of kfree. This is done using Coccinelle and semantic patch used is as follows: // @@ expression x,E,c; @@ x = \(kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\)(c,…) … when != x = E when != &x ?-kfree(x) +kmem_cache_free(c,x) // Acked-by: John Youn Signed-off-by: Amitoj …

Continue reading

BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.