Skip to contentSkip to conversation

staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c

PATCH In review Diego Fernando Mancera Gómez 3 participants 3 messages May 22 – Jul 7 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c

Refactored redundant if-else blocks to a cleaner else-if structure in odm_HWConfig.c and fixed indentation to use tabs as required by the kernel coding style.

---
v3: Restored accidentally removed comments and blank line.
v2: Added commit body description and Signed-off-by tag.
v1: Initial cleanup of if-else logic.

 drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +4 -7
index c88d669cb086..abf3d96746b9 100644
@@ -227,19 +227,16 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
 
 		odm_parsing_cfo(dm_odm, pkt_info, phy_sta_rpt->path_cfotail);
 	}
-
 	/*
 	 * UI BSS List signal strength(in percentage), make it good
 	 * looking, from 0~100.
 	 * It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp().
 	 */
-	if (is_cck_rate) {
+	if (is_cck_rate)
 		phy_info->signal_strength = (u8)(odm_signal_scale_mapping(dm_odm, pwdb_all));
-	} else {
-		if (rf_rx_num != 0) {
-			phy_info->signal_strength = (u8)(odm_signal_scale_mapping(dm_odm, total_rssi /= rf_rx_num));
-		}
-	}
+	else if (rf_rx_num != 0)
+		phy_info->signal_strength = (u8)(odm_signal_scale_mapping(dm_odm, total_rssi /= rf_rx_num));
+
 }
 
 static void odm_Process_RSSIForDM(
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Diego Fernando Mancera Gómez

Refactored redundant if-else blocks to a cleaner else-if structure in odm_HWConfig.c and fixed indentation to use tabs as required by the kernel coding style.

---

Please slow down. Wait a day between resends.

regards,
dan carpenter

maintainer
#2 lore raw
In reply to Diego Fernando Mancera Gómez
Quoted 18 lines · Diego Fernando Mancera Gómez

Refactored redundant if-else blocks to a cleaner else-if structure in odm_HWConfig.c and fixed indentation to use tabs as required by the kernel coding style.

---
v3: Restored accidentally removed comments and blank line.
v2: Added commit body description and Signed-off-by tag.
v1: Initial cleanup of if-else logic.

 drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +0 -0
index c88d669cb086..abf3d96746b9 100644

drivers/staging/rtl8723bs/hal/odm_HWConfig.c static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm, · line 230

Quoted 5 lines
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +0 -1
@@ -227,19 +227,16 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
 
 		odm_parsing_cfo(dm_odm, pkt_info, phy_sta_rpt->path_cfotail);
 	}
-
 	/*

Why did you delete this blank line?

thanks,

greg k-h