staging: i4l: act2000: Move assignment out of if statement
authorsayli karnik <karniksayli1995@gmail.com>
Mon, 19 Sep 2016 14:32:40 +0000 (20:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2016 11:46:32 +0000 (13:46 +0200)
This patch places assignments which are inside the if condition, above it.
Done using coccinelle:

@@
statement s;
expression e;
identifier id;
@@
- if ((id = e))
+ id = e;
+ if (id)
        s

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/i4l/act2000/module.c

index 39a8940b6ae5cc13a350485e8e558507d955ddbb..99c9c0a1c63e3158284bd47ee8345b0028c649b9 100644 (file)
@@ -289,7 +289,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
                        if (copy_from_user(tmp, arg,
                                           sizeof(tmp)))
                                return -EFAULT;
-                       if ((ret = act2000_set_msn(card, tmp)))
+                       ret = act2000_set_msn(card, tmp);
+                       if (ret)
                                return ret;
                        if (card->flags & ACT2000_FLAGS_RUNNING)
                                return (actcapi_manufacturer_req_msn(card));