[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190520085431.GC19183@kroah.com>
Date: Mon, 20 May 2019 10:54:31 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Hariprasad Kelam <hariprasad.kelam@...il.com>
Cc: Emanuel Bennici <benniciemanuel78@...il.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Madhumitha Prabakaran <madhumithabiw@...il.com>,
Hans de Goede <hdegoede@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Alexander Duyck <alexander.h.duyck@...el.com>,
Paolo Abeni <pabeni@...hat.com>, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: os_dep: os_intfs: fix warning
Unneeded variable: "status". Return "_SUCCESS"
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@...il.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
Powered by blists - more mailing lists