staging: rtl8723bs: remove empty if branch in halbtc8723b1ant_RunSwCoexistMechanism
PATCH 1/1 staging: rtl8723bs: remove empty if branch in halbtc8723b1ant_RunSwCoexistMechanism
In halbtc8723b1ant_RunSwCoexistMechanism(), the if branch checking halbtc8723b1ant_IsCommonAction() is empty, leaving the assignment to preAlgorithm in the else branch. This triggers a checkpatch warning about unnecessary braces for single-statement blocks.
Invert the condition and eliminate the empty if branch and braces, simplifying the logic and resolving the checkpatch warning.
--- drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +1 -4
@@ -1903,11 +1903,8 @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist algorithm =halbtc8723b1ant_ActionAlgorithm (pBtCoexist); pCoexDm->curAlgorithm = algorithm; -if (halbtc8723b1ant_IsCommonAction (pBtCoexist)) { - - }else { +if (!halbtc8723b1ant_IsCommonAction (pBtCoexist)) pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; - } }static void halbtc8723b1ant_RunCoexistMechanism (struct btc_coexist *pBtCoexist)
Signature · 1 line
2.53.0
Quoted 20 lines · Nithishvelan M
In
halbtc8723b1ant_RunSwCoexistMechanism(), the if branch checkinghalbtc8723b1ant_IsCommonAction()is empty, leaving the assignment to preAlgorithm in the else branch. This triggers a checkpatch warning about unnecessary braces for single-statement blocks.Invert the condition and eliminate the empty if branch and braces, simplifying the logic and resolving the checkpatch warning.
Signed-off-by Nithishvelan M <[email protected]>--- drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +0
-0@@ -1903,11 +1903,8 @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist algorithm =halbtc8723b1ant_ActionAlgorithm (pBtCoexist); pCoexDm->curAlgorithm = algorithm;
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist · line 1910
Quoted 10 lines
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +1
-4-if (halbtc8723b1ant_IsCommonAction (pBtCoexist)) { - - }else { +if (!halbtc8723b1ant_IsCommonAction (pBtCoexist)) pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; - } }static void halbtc8723b1ant_RunCoexistMechanism (struct btc_coexist *pBtCoexist)
This driver is going to be deleted in the next release, have a look:
https://lore.kernel.org/linux-staging/[email protected]/
Regards,
Ahmet Sezgin Duran