diff options
author | Nishka Dasgupta <nishkadg.linux@gmail.com> | 2019-06-10 13:52:53 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-13 11:39:31 +0200 |
commit | 1f1e13017d64dc5b57eaff094da5148248cf080d (patch) | |
tree | 3d287f51f7e7e1080a81597d6eead45e00df0aa8 /drivers/staging/rtl8712/rtl871x_ioctl_linux.c | |
parent | c77a6794c0fe543df7226ab045e0f507a0b24aee (diff) | |
download | linux-1f1e13017d64dc5b57eaff094da5148248cf080d.tar.bz2 |
staging: rtl8712: Change return values of r8712_setdatarate_cmd()
Change the return values of function r8712_setdatarate_cmd from _SUCCESS
and _FAIL to 0 and -ENOMEM respectively.
Change the return type of the function from u8 to int to reflect this.
Change the call site of the function to check for 0 instead of _SUCCESS.
Return the value at the call site directly instead of storing it in a
return variable.
Remove now-unused return variable.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_ioctl_linux.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index b424b8436fcf..a224797cd993 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -1309,7 +1309,7 @@ static int r8711_wx_set_rate(struct net_device *dev, u32 ratevalue = 0; u8 datarates[NumRates]; u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff}; - int i, ret = 0; + int i; if (target_rate == -1) { ratevalue = 11; @@ -1367,9 +1367,7 @@ set_rate: datarates[i] = 0xff; } } - if (r8712_setdatarate_cmd(padapter, datarates) != _SUCCESS) - ret = -ENOMEM; - return ret; + return r8712_setdatarate_cmd(padapter, datarates); } static int r8711_wx_get_rate(struct net_device *dev, |