This patchset fixes some compiler warnings related to unused variables:
1. Removes unused variable after applying of
https://lore.kernel.org/linux-staging/99b111d2bac822b9dc7ff6e1cfd3d3efc62ef836.1618064275.git.fabioaiuto83@gmail.com/
and the issue was reported by kernel test robot:
https://lore.kernel.org/linux-staging/[email protected]/
2. Fixes two long lines checkpatch issues
3. Removes unused variable
Fabio Aiuto (3):
staging: rtl8723bs: remove unused variable ret in hal/sdio_halinit.c
staging rtl8723bs: split long lines
staging: rtl8723bs: remove unused variable 'start' in
hal/sdio_halinit.c
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
--
2.20.1
fix following post-commit hook checkpatch issues:
WARNING: line length of 116 exceeds 100 columns
30: FILE: drivers/staging/rtl8723bs/hal/sdio_halinit.c:883:
+ HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK,
PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow);
WARNING: line length of 119 exceeds 100 columns
41: FILE: drivers/staging/rtl8723bs/hal/sdio_halinit.c:912:
+ HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK,
PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow);
Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 936181a73d73..552afbaff081 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -880,7 +880,8 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
u8 bMacPwrCtrlOn;
/* Run LPS WL RFOFF flow */
- 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,7 +910,8 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
bMacPwrCtrlOn = false; /* Disable CMD53 R/W */
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
- 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);
}
static u32 rtl8723bs_hal_deinit(struct adapter *padapter)
--
2.20.1
fix following W=1 compiler issue:
drivers/staging/rtl8723bs/hal/sdio_halinit.c:
In function '_ReadAdapterInfo8723BS':
drivers/staging/rtl8723bs/hal/sdio_halinit.c:1156:16:
warning: variable 'start' set but not used [-Wunused-but-set-variable]
1156 | unsigned long start;
| ^~~~~
Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 552afbaff081..28bb4aaedc5b 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -1153,7 +1153,6 @@ static void _InitOtherVariable(struct adapter *Adapter)
static s32 _ReadAdapterInfo8723BS(struct adapter *padapter)
{
u8 val8;
- unsigned long start;
/* before access eFuse, make sure card enable has been called */
if (!padapter->hw_init_completed)
@@ -1164,9 +1163,6 @@ static s32 _ReadAdapterInfo8723BS(struct adapter *padapter)
val8 |= BIT(6);
rtw_write8(padapter, 0x4e, val8);
-
- start = jiffies;
-
_EfuseCellSel(padapter);
_ReadRFType(padapter);
_ReadPROMContent(padapter);
--
2.20.1
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 <[email protected]>
Signed-off-by: Fabio Aiuto <[email protected]>
---
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);
}
static u32 rtl8723bs_hal_deinit(struct adapter *padapter)
--
2.20.1
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 <[email protected]>
> Signed-off-by: Fabio Aiuto <[email protected]>
> ---
> 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
On Sun, Apr 11, 2021 at 02:57:36PM +0200, Fabio Aiuto wrote:
> fix following post-commit hook checkpatch issues:
>
> WARNING: line length of 116 exceeds 100 columns
> 30: FILE: drivers/staging/rtl8723bs/hal/sdio_halinit.c:883:
> + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK,
> PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow);
>
> WARNING: line length of 119 exceeds 100 columns
> 41: FILE: drivers/staging/rtl8723bs/hal/sdio_halinit.c:912:
> + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK,
> PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow);
>
> Signed-off-by: Fabio Aiuto <[email protected]>
> ---
> drivers/staging/rtl8723bs/hal/sdio_halinit.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
You forgot a ':' in your subject line :(
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 <[email protected]>
> > Signed-off-by: Fabio Aiuto <[email protected]>
> > ---
> > 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