diff options
author | Amitkumar Karwar <amit.karwar@redpinesignals.com> | 2017-07-11 16:27:53 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-07-28 16:27:19 +0200 |
commit | e6249e15fea2f915ddfcbee8efd9120cb64ed93d (patch) | |
tree | 267900da4a2657ee489a537f2e818fd3d923c74c /drivers/net/wireless/rsi | |
parent | rsi: check length before USB read/write register (diff) | |
download | linux-e6249e15fea2f915ddfcbee8efd9120cb64ed93d.tar.xz linux-e6249e15fea2f915ddfcbee8efd9120cb64ed93d.zip |
rsi: fix static checker warning
u32 pointer is changed to u16 and filled the value. Problem is
solved by using local temporary variable. Below static checker
warning was reported.
drivers/net/wireless/rsi/rsi_91x_usb.c:400 rsi_usb_master_reg_read()
warn: passing casted pointer 'value' to 'rsi_usb_reg_read()'
32 vs 16.
Fixes: b97e9b94ad75c ("rsi: Add new host interface operations")
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/rsi')
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 3d33ce9ca2ba..9097f7e6229e 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -404,8 +404,15 @@ static int rsi_usb_master_reg_read(struct rsi_hw *adapter, u32 reg, { struct usb_device *usbdev = ((struct rsi_91x_usbdev *)adapter->rsi_dev)->usbdev; + u16 temp; + int ret; - return rsi_usb_reg_read(usbdev, reg, (u16 *)value, len); + ret = rsi_usb_reg_read(usbdev, reg, &temp, len); + if (ret < 0) + return ret; + *value = temp; + + return 0; } static int rsi_usb_master_reg_write(struct rsi_hw *adapter, |