Skip to contentSkip to conversation

staging: rtl8723bs: remove empty if branch in halbtc8723b1ant_RunSwCoexistMechanism

PATCH In review Nithishvelan M 2 participants 2 messages Oct 18 Staging

lore
Share & tools
lore
#0 lore raw

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
index 0613beaa37..dfe921033f 100644
@@ -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
#1 lore raw
Quoted 20 lines · Nithishvelan M

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 +0 -0
index 0613beaa37..dfe921033f 100644
@@ -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