From: Phillip Potter <phil@philpotter.co.uk>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
linux-staging@lists.linux.dev,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"Fabio M . De Francesco" <fmdefrancesco@gmail.com>
Subject: Re: [PATCH] staging: r8188eu: Remove unnecessary ret variable in rtw_drv_init()
Date: Sat, 14 Aug 2021 18:16:47 +0100 [thread overview]
Message-ID: <CAA=Fs0nbbzOKhYs_AgpiAfDCLvuUGKz0cSSHwxct6k4eFzEUZg@mail.gmail.com> (raw)
In-Reply-To: <20210813201418.4018631-1-nathan@kernel.org>
On Fri, 13 Aug 2021 at 21:14, Nathan Chancellor <nathan@kernel.org> wrote:
>
> ret is unnecessary as both error paths set the same error code so just
> return that directly.
>
> Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/staging/r8188eu/os_dep/usb_intf.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
> index 667f41125a87..3e5f4b5eb0fc 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
> @@ -705,22 +705,18 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
> {
> struct adapter *if1 = NULL;
> struct dvobj_priv *dvobj;
> - int ret;
>
> /* step 0. */
> process_spec_devid(pdid);
>
> /* Initialize dvobj_priv */
> dvobj = usb_dvobj_init(pusb_intf);
> - if (!dvobj) {
> - ret = -ENODEV;
> + if (!dvobj)
> goto err;
> - }
>
> if1 = rtw_usb_if1_init(dvobj, pusb_intf);
> if (!if1) {
> DBG_88E("rtw_init_primarystruct adapter Failed!\n");
> - ret = -ENODEV;
> goto free_dvobj;
> }
>
> @@ -734,7 +730,7 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
> free_dvobj:
> usb_dvobj_deinit(pusb_intf);
> err:
> - return ret;
> + return -ENODEV;
> }
>
> /*
>
> base-commit: 0bd35146642bdc56f1b87d75f047b1c92bd2bd39
> --
> 2.33.0.rc2
>
Dear Nathan,
Thanks for this.
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Regards,
Phil
next prev parent reply other threads:[~2021-08-14 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 20:14 [PATCH] staging: r8188eu: Remove unnecessary ret variable in rtw_drv_init() Nathan Chancellor
2021-08-13 21:55 ` Fabio M. De Francesco
2021-08-14 17:16 ` Phillip Potter [this message]
2021-08-16 9:05 ` Dan Carpenter
2021-08-16 10:15 ` Fabio M. De Francesco
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='CAA=Fs0nbbzOKhYs_AgpiAfDCLvuUGKz0cSSHwxct6k4eFzEUZg@mail.gmail.com' \
--to=phil@philpotter.co.uk \
--cc=Larry.Finger@lwfinger.net \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=nathan@kernel.org \
/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).