staging: rtl8188eu: clean up usb_write16
authorMartin Kaiser <martin@kaiser.cx>
Tue, 6 Apr 2021 20:48:27 +0000 (22:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 08:24:47 +0000 (10:24 +0200)
Remove unnecessary variable, summarize declaration and assignment.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210406204829.18130-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c

index e2ff4f7..9d0c34f 100644 (file)
@@ -495,16 +495,10 @@ int usb_write8(struct adapter *adapter, u32 addr, u8 val)
 
 int usb_write16(struct adapter *adapter, u32 addr, u16 val)
 {
-       u16 wvalue;
-       u16 len;
-       __le32 data;
-
-       wvalue = (u16)(addr & 0x0000ffff);
-       len = 2;
-
-       data = cpu_to_le32(val & 0x0000ffff);
+       u16 wvalue = (u16)(addr & 0xffff);
+       __le32 data = cpu_to_le32(val & 0xffff);
 
-       return usbctrl_vendorreq(adapter, wvalue, &data, len, REALTEK_USB_VENQT_WRITE);
+       return usbctrl_vendorreq(adapter, wvalue, &data, 2, REALTEK_USB_VENQT_WRITE);
 }
 
 int usb_write32(struct adapter *adapter, u32 addr, u32 val)