staging: rtl8723bs: Simplify boolean expression
PATCH 1/1 staging: rtl8723bs: Simplify boolean expression
Simplify expression that it's inverting a boolean value. Issue found by Coccinelle.
--- drivers/staging/rtl8723bs/hal/rtl8723b_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +1 -1
@@ -188,7 +188,7 @@ void rtl8723b_HalDmWatchDog(struct adapter *Adapter) bBtDisabled =hal_btcoex_IsBtDisabled (Adapter); -ODM_CmnInfoUpdate (&pHalData->odmpriv,ODM_CMNINFO_BT_ENABLED , ((bBtDisabled == true)?false:true)); +ODM_CmnInfoUpdate (&pHalData->odmpriv,ODM_CMNINFO_BT_ENABLED , !(bBtDisabled));ODM_DMWatchdog (&pHalData->odmpriv); }
Signature · 1 line
2.20.1
Quoted 13 lines · Javier F. Arias
Simplify expression that it's inverting a boolean value. Issue found by Coccinelle.
Signed-off-by Javier F. Arias <[email protected]>--- drivers/staging/rtl8723bs/hal/rtl8723b_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +0
-0
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c void rtl8723b_HalDmWatchDog(struct adapter *Adapter) · line 191
Quoted 5 lines
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +1
-1@@ -188,7 +188,7 @@ void rtl8723b_HalDmWatchDog(struct adapter *Adapter) bBtDisabled =hal_btcoex_IsBtDisabled (Adapter); -ODM_CmnInfoUpdate (&pHalData->odmpriv,ODM_CMNINFO_BT_ENABLED , ((bBtDisabled == true)?false:true)); +ODM_CmnInfoUpdate (&pHalData->odmpriv,ODM_CMNINFO_BT_ENABLED , !(bBtDisabled));
This looks really helpful to improve readability.
At the same time, could you remove the () around bBtDisabled?
And make a series where in the other patch you address the 80 character issue. Then this code will look nice overall.
thanks,
julia
Quoted 11 lines
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +0
-1ODM_DMWatchdog (&pHalData->odmpriv); } --2.20.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191018035912.GA5198%40gmail.com.