[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210924122705.3781-9-fmdefrancesco@gmail.com>
Date: Fri, 24 Sep 2021 14:26:57 +0200
From: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
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>,
Michael Straube <straube.linux@...il.com>,
Martin Kaiser <martin@...ser.cx>
Cc: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
Subject: [PATCH v10 08/16] staging: r8188eu: change the type of a variable in rtw_write16()
Change the type of "data" from __le32 to __le16 in rtw_write16(). The
argument "val", which is u16, after being conditionally swapped to little
endian, is assigned to "data"; therefore, __le16 is the most suitable type
for "data". Remove the bitwise AND of "val" with 0xffff because it is
redundant. Use cpu_to_le16() because "data" is __le16.
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index 95cd7a6bc28b..5dcab1ee4be0 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -145,7 +145,7 @@ int rtw_write16(struct adapter *adapter, u32 addr, u16 val)
struct io_priv *io_priv = &adapter->iopriv;
struct intf_hdl *intf = &io_priv->intf;
u16 value = addr & 0xffff;
- __le32 data = cpu_to_le32(val & 0x0000ffff);
+ __le16 data = cpu_to_le16(val);
int ret;
ret = usbctrl_vendorreq(intf, value, &data, 2, REALTEK_USB_VENQT_WRITE);
--
2.33.0
Powered by blists - more mailing lists