From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
lkp@intel.com
Subject: Re: [PATCH 1/3] staging: rtl8723bs: remove unused variable ret in hal/sdio_halinit.c
Date: Mon, 12 Apr 2021 13:57:17 +0200 [thread overview]
Message-ID: <20210412115716.GA1415@agape.jhs> (raw)
In-Reply-To: <YHQVKPOoGS3auAeQ@kroah.com>
On Mon, Apr 12, 2021 at 11:38:48AM +0200, Greg KH wrote:
> On Sun, Apr 11, 2021 at 02:57:35PM +0200, Fabio Aiuto wrote:
> > fix following compiler warning issue:
> >
> > drivers/staging/rtl8723bs/hal/sdio_halinit.c:
> > In function 'CardDisableRTL8723BSdio':
> > >> drivers/staging/rtl8723bs/hal/sdio_halinit.c:881:5:
> > warning: variable 'ret' set but not used [-Wunused-but-set-variable]
> > 881 | u8 ret = _FAIL;
> > | ^~~
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
> > ---
> > drivers/staging/rtl8723bs/hal/sdio_halinit.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> > index 2098384efe92..936181a73d73 100644
> > --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> > +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> > @@ -878,10 +878,9 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
> > {
> > u8 u1bTmp;
> > u8 bMacPwrCtrlOn;
> > - u8 ret = _FAIL;
> >
> > /* Run LPS WL RFOFF flow */
> > - ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow);
> > + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow);
> >
> > /* ==== Reset digital sequence ====== */
> >
> > @@ -909,9 +908,8 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
> > /* ==== Reset digital sequence end ====== */
> >
> > bMacPwrCtrlOn = false; /* Disable CMD53 R/W */
> > - ret = false;
> > rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
> > - ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow);
> > + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow);
> > }
>
> Why isn't the return value being checked and returned to the caller if
> something goes wrong? Ignoring it feels wrong to me.
>
> thanks,
>
> greg k-h
ok, I will propagate the return value to the whole caller chain.
CardDisableRTL8723BSdio returns void, will change this to u8...
thank you,
fabio
next prev parent reply other threads:[~2021-04-12 11:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-11 12:57 [PATCH 0/3] staging: rtl8723bs: fix compiler 'W=1' warnings Fabio Aiuto
2021-04-11 12:57 ` [PATCH 1/3] staging: rtl8723bs: remove unused variable ret in hal/sdio_halinit.c Fabio Aiuto
2021-04-12 9:38 ` Greg KH
2021-04-12 11:57 ` Fabio Aiuto [this message]
2021-04-11 12:57 ` [PATCH 2/3] staging rtl8723bs: split long lines Fabio Aiuto
2021-04-12 9:39 ` Greg KH
2021-04-11 12:57 ` [PATCH 3/3] staging: rtl8723bs: remove unused variable 'start' in hal/sdio_halinit.c Fabio Aiuto
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=20210412115716.GA1415@agape.jhs \
--to=fabioaiuto83@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=lkp@intel.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