staging: rtl8188eu: Compress two statements into one.
authorNavya Sri Nizamkari <navyasri.tech@gmail.com>
Fri, 27 Feb 2015 20:36:44 +0000 (02:06 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 00:22:52 +0000 (16:22 -0800)
This patch removes the use of a variable used only for
returning a value. The following coccinelle script was
used to discover it:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
     -return ret;

It also fixes the checkpatch.pl warning about line being over
80 characters, in the lines where changes were made.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c

index 80e7ef96d807e4f7d5fae5439102fd413b9d3042..b9e1a61f67caebec7df4d2ff1f22967875e6a7db 100644 (file)
@@ -552,7 +552,6 @@ int usb_write8(struct adapter *adapter, u32 addr, u8 val)
        u16 index;
        u16 len;
        u8 data;
-       int ret;
 
        request = 0x05;
        requesttype = 0x00;/* write_out */
@@ -560,8 +559,8 @@ int usb_write8(struct adapter *adapter, u32 addr, u8 val)
        wvalue = (u16)(addr&0x0000ffff);
        len = 1;
        data = val;
-       ret = usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
-       return ret;
+       return usbctrl_vendorreq(adapter, request, wvalue,
+                                index, &data, len, requesttype);
 }
 
 int usb_write16(struct adapter *adapter, u32 addr, u16 val)
@@ -572,7 +571,6 @@ int usb_write16(struct adapter *adapter, u32 addr, u16 val)
        u16 index;
        u16 len;
        __le32 data;
-       int ret;
 
 
        request = 0x05;
@@ -584,10 +582,10 @@ int usb_write16(struct adapter *adapter, u32 addr, u16 val)
 
        data = cpu_to_le32(val & 0x0000ffff);
 
-       ret = usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
+       return usbctrl_vendorreq(adapter, request, wvalue,
+                                index, &data, len, requesttype);
 
 
-       return ret;
 }
 
 int usb_write32(struct adapter *adapter, u32 addr, u32 val)
@@ -598,7 +596,6 @@ int usb_write32(struct adapter *adapter, u32 addr, u32 val)
        u16 index;
        u16 len;
        __le32 data;
-       int ret;
 
 
        request = 0x05;
@@ -609,10 +606,10 @@ int usb_write32(struct adapter *adapter, u32 addr, u32 val)
        len = 4;
        data = cpu_to_le32(val);
 
-       ret = usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
+       return usbctrl_vendorreq(adapter, request, wvalue,
+                                index, &data, len, requesttype);
 
 
-       return ret;
 }
 
 static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)