Skip to contentSkip to conversation

Staging: rtl8188eu: Refactor conditional code to increase readability

PATCH New Vatika Harlalka 1 participant 1 message Feb 26, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8188eu: Refactor conditional code to increase readability

Remove the nested conditionals. The if and else-if have the same code so they are combined to make the code more compact.

---
 drivers/staging/rtl8188eu/hal/phy.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/staging/rtl8188eu/hal/phy.c +3 -9
index a708ff9..1d9c662 100644
@@ -522,18 +522,12 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
 		temp_cck = dm_odm->RFCalibrateInfo.RegA24;
 
 		for (i = 0; i < CCK_TABLE_SIZE; i++) {
-			if (dm_odm->RFCalibrateInfo.bCCKinCH14) {
-				if (memcmp(&temp_cck, &CCKSwingTable_Ch14[i][2], 4)) {
+			if ((dm_odm->RFCalibrateInfo.bCCKinCH14 &&
+				memcmp(&temp_cck, &CCKSwingTable_Ch14[i][2], 4)) ||
+				memcmp(&temp_cck, &CCKSwingTable_Ch1_Ch13[i][2], 4)) {
 					cck_index_old = (u8)i;
 					dm_odm->BbSwingIdxCckBase = (u8)i;
 					break;
-				}
-			} else {
-				if (memcmp(&temp_cck, &CCKSwingTable_Ch1_Ch13[i][2], 4)) {
-					cck_index_old = (u8)i;
-					dm_odm->BbSwingIdxCckBase = (u8)i;
-					break;
-				}
 			}
 		}
 
Signature · 1 line
1.9.1