[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e065cba-8094-3900-67e6-3a647bec3a7c@gmail.com>
Date: Thu, 3 Nov 2022 06:37:38 +0100
From: Michael Straube <straube.linux@...il.com>
To: Phillip Potter <phil@...lpotter.co.uk>, gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, paskripkin@...il.com,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: r8188eu: change return type of
rtw_set_802_11_disassociate to void
Hi Phillip,
On 11/3/22 00:36, Phillip Potter wrote:
> Change return type of rtw_set_802_11_disassociate to void. This function
> always returns 'true' no matter what, so there is no need to return a
> value, and no need to check for it in the two call sites within
> rtw_wx_set_mlme.
>
> Signed-off-by: Phillip Potter <phil@...lpotter.co.uk>
> ---
> drivers/staging/r8188eu/core/rtw_ioctl_set.c | 4 +---
> drivers/staging/r8188eu/include/rtw_ioctl_set.h | 2 +-
> drivers/staging/r8188eu/os_dep/ioctl_linux.c | 6 ++----
> 3 files changed, 4 insertions(+), 8 deletions(-)
>
<snip>
> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> @@ -1020,12 +1020,10 @@ static int rtw_wx_set_mlme(struct net_device *dev,
>
> switch (mlme->cmd) {
> case IW_MLME_DEAUTH:
> - if (!rtw_set_802_11_disassociate(padapter))
> - ret = -1;
> + rtw_set_802_11_disassociate(padapter);
> break;
> case IW_MLME_DISASSOC:
> - if (!rtw_set_802_11_disassociate(padapter))
> - ret = -1;
> + rtw_set_802_11_disassociate(padapter);
> break;
> default:
> return -EOPNOTSUPP;
You could also remove the ret variable and return 0 directly, since ret
is not changed anymore in the function.
regards,
Michael
Powered by blists - more mailing lists