staging: r8188eu: clean up the usb_readXY functions

Remove unnecessary variables, summarize declarations and assignments.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Martin Kaiser 2021-08-21 18:48:55 +02:00 committed by Greg Kroah-Hartman
parent 2214ea8299
commit 0d3e1be506
1 changed files with 7 additions and 23 deletions

View File

@ -98,46 +98,30 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata,
static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
{
u16 wvalue;
u16 len;
u8 data = 0;
wvalue = (u16)(addr & 0x0000ffff);
len = 1;
usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_READ);
u16 wvalue = (u16)(addr & 0x0000ffff);
u8 data;
usbctrl_vendorreq(pintfhdl, wvalue, &data, 1, REALTEK_USB_VENQT_READ);
return data;
}
static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
{
u16 wvalue;
u16 len;
u16 wvalue = (u16)(addr & 0x0000ffff);
__le32 data;
wvalue = (u16)(addr & 0x0000ffff);
len = 2;
usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_READ);
usbctrl_vendorreq(pintfhdl, wvalue, &data, 2, REALTEK_USB_VENQT_READ);
return (u16)(le32_to_cpu(data) & 0xffff);
}
static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
{
u16 wvalue;
u16 len;
u16 wvalue = (u16)(addr & 0x0000ffff);
__le32 data;
wvalue = (u16)(addr & 0x0000ffff);
len = 4;
usbctrl_vendorreq(pintfhdl, wvalue, &data, len, REALTEK_USB_VENQT_READ);
usbctrl_vendorreq(pintfhdl, wvalue, &data, 4, REALTEK_USB_VENQT_READ);
return le32_to_cpu(data);
}