staging: gdm72xx: compress return logic into one line
authorAlison Schofield <amsfield22@gmail.com>
Wed, 10 Feb 2016 18:34:00 +0000 (10:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Feb 2016 04:00:30 +0000 (20:00 -0800)
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 <amsfield22@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gdm72xx/netlink_k.c
drivers/staging/gdm72xx/usb_boot.c

index b7e5e706d37a3c6c37f40e95dbc6bd3f2eb0bb66..cf0b47cb1ceb44dac43be2379ec1d397cf211ff9 100644 (file)
@@ -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;
 }
index 39ca34031a6b7d662d0c071a51e0a4e3cc967ce3..30829875da2e9cd542959770733bd6140c97cb20 100644 (file)
@@ -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);
 }