staging: gdm72xx: compress return logic into one line
PATCH 1/1 staging: gdm72xx: compress return logic into one line
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 <[email protected]>
--- drivers/staging/gdm72xx/netlink_k.c | 3 +-- drivers/staging/gdm72xx/usb_boot.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/staging/gdm72xx/netlink_k.c +1 -2
@@ -151,6 +151,5 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)pr_err ("netlink_broadcast g=%d, t=%d, l=%d, r=%d\n" , group, type, len, ret); } - ret =0 ; -return ret; +return 0 ; }
drivers/staging/gdm72xx/usb_boot.c +1 -3
@@ -357,7 +357,5 @@ int usb_emergency(struct usb_device *usbdev)return ret;dev_info (&usbdev->dev,"GCT Emergency: Filesystem download success.\n" ); - ret =em_fw_reset (usbdev); - -return ret; +return em_fw_reset (usbdev); }
Signature · 1 line
2.1.4
Quoted 11 lines · Alison Schofield
Simplify function returns by merging assignment and return into one command line.
Found with Coccinelle
@@
expression e, ret;
@@(quoted diff) +1
-1-ret = +returne;-return ret;
Looks good.
Acked-by Julia Lawall <[email protected]>
Quoted 42 lines
Signed-off-by Alison Schofield <[email protected]>--- drivers/staging/gdm72xx/netlink_k.c | 3 +-- drivers/staging/gdm72xx/usb_boot.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-)drivers/staging/gdm72xx/netlink_k.c +1
-2@@ -151,6 +151,5 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)pr_err ("netlink_broadcast g=%d, t=%d, l=%d, r=%d\n" , group, type, len, ret); } - ret =0 ; -return ret; +return 0 ; }drivers/staging/gdm72xx/usb_boot.c +1
-3@@ -357,7 +357,5 @@ int usb_emergency(struct usb_device *usbdev)return ret;dev_info (&usbdev->dev,"GCT Emergency: Filesystem download success.\n" ); - ret =em_fw_reset (usbdev); - -return ret; +return em_fw_reset (usbdev); }Signature · 8 lines
2.1.4 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160210183350.GA12708%40d830.WORKGROUP. For more options, visit https://groups.google.com/d/optout.