[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210919235356.4151-14-fmdefrancesco@gmail.com>
Date: Mon, 20 Sep 2021 01:53:50 +0200
From: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Pavel Skripkin <paskripkin@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
David Laight <david.Laight@...lab.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Martin Kaiser <martin@...ser.cx>
Cc: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
Subject: [PATCH v8 13/19] staging: r8188eu: remove an unneeded buffer from rtw_writeN()
Remove the unnecessary buffer "u8 buf[VENDOR_CMD_MAX_DATA_LEN]" and
pass directly "data" to usbctrl_vendorreq().
Co-developed-by: Pavel Skripkin <paskripkin@...il.com>
Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@...il.com>
---
drivers/staging/r8188eu/hal/usb_ops_linux.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index b2a5b6ffbb46..aa57bd7b8f10 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -173,14 +173,12 @@ int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
struct io_priv *io_priv = &adapter->iopriv;
struct intf_hdl *intfhdl = &io_priv->intf;
u16 value = addr & 0xffff;
- u8 buf[VENDOR_CMD_MAX_DATA_LEN] = {0};
int ret;
if (length > VENDOR_CMD_MAX_DATA_LEN)
return _FAIL;
- memcpy(buf, data, length);
- ret = usbctrl_vendorreq(intfhdl, value, buf, (length & 0xffff), REALTEK_USB_VENQT_WRITE);
+ ret = usbctrl_vendorreq(intfhdl, value, data, (length & 0xffff), REALTEK_USB_VENQT_WRITE);
return RTW_STATUS_CODE(ret);
}
--
2.33.0
Powered by blists - more mailing lists