Staging:wlan-ng:Merged two lines into one
authorBhumika Goyal <bhumirks@gmail.com>
Mon, 8 Feb 2016 19:58:10 +0000 (01:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2016 01:43:09 +0000 (17:43 -0800)
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 <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x_usb.c

index 682de77e75614c7f93ac5415b0ec23eb1519e737..fda8a95cb721b6e12001feba0d73f30dd4de8aa0 100644 (file)
@@ -1012,7 +1012,6 @@ int hfa384x_cmd_initialize(hfa384x_t *hw)
 ----------------------------------------------------------------*/
 int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
 {
-       int result = 0;
        hfa384x_metacmd_t cmd;
 
        cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_DISABLE) |
@@ -1021,9 +1020,7 @@ int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
        cmd.parm1 = 0;
        cmd.parm2 = 0;
 
-       result = hfa384x_docmd_wait(hw, &cmd);
-
-       return result;
+       return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*----------------------------------------------------------------
@@ -1048,7 +1045,6 @@ int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport)
 ----------------------------------------------------------------*/
 int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
 {
-       int result = 0;
        hfa384x_metacmd_t cmd;
 
        cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ENABLE) |
@@ -1057,9 +1053,7 @@ int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
        cmd.parm1 = 0;
        cmd.parm2 = 0;
 
-       result = hfa384x_docmd_wait(hw, &cmd);
-
-       return result;
+       return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*----------------------------------------------------------------
@@ -1093,7 +1087,6 @@ int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport)
 ----------------------------------------------------------------*/
 int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
 {
-       int result = 0;
        hfa384x_metacmd_t cmd;
 
        cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
@@ -1102,9 +1095,7 @@ int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
        cmd.parm1 = 0;
        cmd.parm2 = 0;
 
-       result = hfa384x_docmd_wait(hw, &cmd);
-
-       return result;
+       return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*----------------------------------------------------------------
@@ -1148,7 +1139,6 @@ int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable)
 int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr,
                         u16 highaddr, u16 codelen)
 {
-       int result = 0;
        hfa384x_metacmd_t cmd;
 
        pr_debug("mode=%d, lowaddr=0x%04x, highaddr=0x%04x, codelen=%d\n",
@@ -1161,9 +1151,7 @@ int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr,
        cmd.parm1 = highaddr;
        cmd.parm2 = codelen;
 
-       result = hfa384x_docmd_wait(hw, &cmd);
-
-       return result;
+       return hfa384x_docmd_wait(hw, &cmd);
 }
 
 /*----------------------------------------------------------------