From: Michael Straube <straube.linux@gmail.com>
To: Phillip Potter <phil@philpotter.co.uk>, gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, paskripkin@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: r8188eu: change return type of rtw_set_802_11_disassociate to void
Date: Thu, 3 Nov 2022 06:37:38 +0100 [thread overview]
Message-ID: <2e065cba-8094-3900-67e6-3a647bec3a7c@gmail.com> (raw)
In-Reply-To: <20221102233637.6648-1-phil@philpotter.co.uk>
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@philpotter.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
next prev parent reply other threads:[~2022-11-03 5:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 23:36 Phillip Potter
2022-11-03 5:37 ` Michael Straube [this message]
2022-11-03 22:53 ` Phillip Potter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e065cba-8094-3900-67e6-3a647bec3a7c@gmail.com \
--to=straube.linux@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paskripkin@gmail.com \
--cc=phil@philpotter.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®