Skip to contentSkip to conversation

staging: rtl8723bs: hal: Compress return logic

PATCH In review Simran Singhal 2 participants 3 messages Mar 25, 2020 – Mar 27, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: hal: Compress return logic

Simplify function returns by merging assignment and return into one command line.
Found with Coccinelle

@@
local idexpression ret;
expression e;
@@

-ret =
+return

     e;

-return ret;

---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c +1 -3
index eb7de3617d83..767e2a784f78 100644
@@ -1498,9 +1498,7 @@ s8 PHY_GetTxPowerByRate(
 		return value;
 	}
 
-	value = pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
-
-	return value;
+	return pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
 
 }
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Simran Singhal

Simplify function returns by merging assignment and return into one command line.

"Simplify function returns by merging assignment and return into one line".

You could change the subject also to "Simplify function return logic".

thanks,
-lakshmi

#2 lore raw
Quoted 9 lines · Lakshmi Ramasubramanian
Quoted 2 lines · Simran Singhal

Simplify function returns by merging assignment and return into one command line.

"Simplify function returns by merging assignment and return into one line".

You could change the subject also to "Simplify function return logic".

Thanks for your suggestion, Lakshmi. Yes, "Simplify function return logic" could be a better subject.

Simran

Quoted 4 lines

thanks,
-lakshmi