From: Phillip Potter <phil@philpotter.co.uk>
To: Michael Straube <straube.linux@gmail.com>
Cc: gregkh@linuxfoundation.org, 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 22:53:18 +0000 [thread overview]
Message-ID: <Y2RGXkUEYrBMBCk/@equinox> (raw)
In-Reply-To: <2e065cba-8094-3900-67e6-3a647bec3a7c@gmail.com>
On Thu, Nov 03, 2022 at 06:37:38AM +0100, Michael Straube wrote:
> 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
Hi Michael,
Thanks for the review, and you're absolutely right. I will publish a V2
shortly.
Regards,
Phil
prev parent reply other threads:[~2022-11-03 22:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 23:36 [PATCH] staging: r8188eu: change return type of rtw_set_802_11_disassociate to void Phillip Potter
2022-11-03 5:37 ` Michael Straube
2022-11-03 22:53 ` Phillip Potter [this message]
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=Y2RGXkUEYrBMBCk/@equinox \
--to=phil@philpotter.co.uk \
--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=straube.linux@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).