Category: Linux

staging: speakup: compress return logic into one line

Author: Alison Schofield <amsfield22@gmail.com> Simplify function return by merging assignment and return into one command line. Remove (now) unused local variable. Found using Coccinelle: @@ expression e, ret; @@ -ret = +return e; -return ret; Signed-off-by: Alison Schofield Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/speakup/i18n.c | 5 +—- 1 file changed, 1 insertion(+), 4 …

Continue reading

staging: gdm72xx: compress return logic into one line

Author: Alison Schofield <amsfield22@gmail.com> Simplify function returns by merging assignment and return into one command line. Found with Coccinelle @@ expression e, ret; @@ -ret = +return e; -return ret; Signed-off-by: Alison Schofield Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/gdm72xx/netlink_k.c | 3 +– drivers/staging/gdm72xx/usb_boot.c | 4 +— 2 files changed, 2 insertions(+), 5 deletions(-) …

Continue reading

dmascc: Return correct error codes

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> This change has been made with the goal that kernel functions should return something more descriptive than -1 on failure. A variable `err` has been introduced for storing error codes. The return value of kzalloc on failure should return a -1 and not a -ENOMEM. This was found using Coccinelle. …

Continue reading

staging: iio: Remove parantheses around right hand side of assignment

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Remove parantheses on the right hand side of assignments as they are not needed. Coccinelle patch used: @@ expression a, b, c, d; @@ ( a = (c == d) | a = – ( b – ) ) Signed-off-by: Janani Ravichandran Signed-off-by: Greg Kroah-Hartman — drivers/staging/iio/adc/ad7280a.c | 4 ++– drivers/staging/iio/light/tsl2x7x_core.c …

Continue reading

staging: rtl8188eu: Remove unnecessary pointer cast

Author: Janani Ravichandran <janani.rvchndrn@gmail.com> Remove unnecessary pointer cast. Issue found using the following Coccinelle semantic patch. @@ type T; T e; identifier x; @@ * T x = (T)e; Signed-off-by: Janani Ravichandran Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index e602026..96e5c6d 100644 …

Continue reading

Staging: lustre: lnet: Remove explicit NULL comparision

Author: Bhumika Goyal <bhumirks@gmail.com> Replaced explicit NULL comparision with its simplier form. Found using coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/lustre/lnet/lnet/lib-md.c | 12 ++++++—— 1 file changed, 6 insertions(+), 6 deletions(-)   diff –git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c index 758f5be..b3d8364 100644 — a/drivers/staging/lustre/lnet/lnet/lib-md.c +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c @@ …

Continue reading

Staging:wlan-ng:Merged two lines into one

Author: Bhumika Goyal <bhumirks@gmail.com> The last two lines of these functions are compressed into one. Also removed the variable ret as it is now not used. Found using coccinelle: @@ expression e, ret; @@ -ret = +return e; -return ret; Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman — drivers/staging/wlan-ng/hfa384x_usb.c | 20 ++++—————- 1 file changed, 4 …

Continue reading

bonding: Return correct error code

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> The return value of kzalloc on failure of allocation of memory should be -ENOMEM and not -1. Found using Coccinelle. A simplified version of the semantic patch used is: // @@ expression *e; @@ e = kzalloc(…); if (e == NULL) { … return – -1 + -ENOMEM ; } …

Continue reading

Staging:iio:Remove exceptional & on function name

Author: Bhumika Goyal <bhumirks@gmail.com> In this file,function names are otherwise used as pointers without &. Found using coccinelle. // @r@ identifier f; @@ f(…) { … } @@ identifier r.f; @@ – &f + f // Signed-off-by: Bhumika Goyal Signed-off-by: Jonathan Cameron — drivers/staging/iio/impedance-analyzer/ad5933.c | 8 ++++—- 1 file changed, 4 insertions(+), 4 deletions(-)   …

Continue reading

USB: serial: fix semicolon.cocci warnings

Author: Mathieu OTHACEHE <m.othacehe@gmail.com> Remove unneeded semicolons. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Mathieu OTHACEHE Signed-off-by: Johan Hovold — drivers/usb/serial/keyspan.c | 2 +- drivers/usb/serial/kl5kusb105.c | 3 — 2 files changed, 1 insertion(+), 4 deletions(-)   diff –git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index e07b15e..b6bd8e4 100644 — a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -1963,7 +1963,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial, if (d_details->product_id …

Continue reading