All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Cc: Emanuel Bennici <benniciemanuel78@gmail.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Madhumitha Prabakaran <madhumithabiw@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Paolo Abeni <pabeni@redhat.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: os_dep: os_intfs: fix warning Unneeded variable: "status". Return "_SUCCESS"
Date: Mon, 20 May 2019 10:54:31 +0200	[thread overview]
Message-ID: <20190520085431.GC19183@kroah.com> (raw)
In-Reply-To: <20190519165758.GA6375@hari-Inspiron-1545>

On Sun, May 19, 2019 at 10:27:58PM +0530, Hariprasad Kelam wrote:
> This patch fixes below warnings reported by coccicheck
> 
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:228:6-12: Unneeded variable:
> "status". Return "_SUCCESS" on line 333
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:607:4-7: Unneeded variable:
> "ret". Return "_SUCCESS" on line 669
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:713:4-8: Unneeded variable:
> "ret8". Return "_SUCCESS" on line 743
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:1379:5-8: Unneeded variable:
> "ret". Return "_SUCCESS" on line 1421
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:1429:5-8: Unneeded variable:
> "ret". Return "_SUCCESS" on line 1451
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:1300:5-8: Unneeded variable:
> "ret". Return "_SUCCESS" on line 1368
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
>  drivers/staging/rtl8723bs/os_dep/os_intfs.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index 8a9d838..71dfac5 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -225,7 +225,6 @@ static int netdev_close (struct net_device *pnetdev);
>  
>  static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev)
>  {
> -	uint status = _SUCCESS;
>  	struct registry_priv  *registry_par = &padapter->registrypriv;
>  
>  	registry_par->chip_version = (u8)rtw_chip_version;
> @@ -330,7 +329,7 @@ static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev)
>  	registry_par->qos_opt_enable = (u8)rtw_qos_opt_enable;
>  
>  	registry_par->hiq_filter = (u8)rtw_hiq_filter;
> -	return status;
> +	return _SUCCESS;
>  }

If this, or any of these other functions, can only return "success",
then why return anything at all?  These should be fixed up to either
properly return an error if one can happen, or be a void function and
fix up the caller function as well.

thanks,

greg k-h

      reply	other threads:[~2019-05-20  8:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-19 16:57 [PATCH] staging: rtl8723bs: os_dep: os_intfs: fix warning Unneeded variable: "status". Return "_SUCCESS" Hariprasad Kelam
2019-05-20  8:54 ` Greg Kroah-Hartman [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=20190520085431.GC19183@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.h.duyck@intel.com \
    --cc=arnd@arndb.de \
    --cc=benniciemanuel78@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=hariprasad.kelam@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madhumithabiw@gmail.com \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.