mirror of https://gitee.com/openkylin/linux.git
staging: rtl8188eu: Compress two statements into one.
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>
This commit is contained in:
parent
3fe9065801
commit
25034ff83c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue