[PATCH v2] staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c

Diego Fernando Mancera Gómez posted 1 patch 2 days, 14 hours ago
There is a newer version of this series
drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
[PATCH v2] staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c
Posted by Diego Fernando Mancera Gómez 2 days, 14 hours ago
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.

Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
---
 drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
index c88d669cb086..2e47734a0ae9 100644
--- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
@@ -228,18 +228,11 @@ 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(
@@ -437,4 +430,3 @@ enum hal_status ODM_ConfigBBWithHeaderFile(
 
 	return HAL_STATUS_SUCCESS;
 }
-
-- 
2.43.0

Re: [PATCH v2] staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c
Posted by Dan Carpenter 2 days, 13 hours ago
On Thu, May 21, 2026 at 11:04:29PM -0600, Diego Fernando Mancera Gómez wrote:
> 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.
> 
> Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
> ---

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Please wait a day between resends.

>  drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> index c88d669cb086..2e47734a0ae9 100644
> --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> @@ -228,18 +228,11 @@ 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));
> +

No need for this extra blank line.

>  }

regards,
dan carpenter

>  
>  static void odm_Process_RSSIForDM(
> @@ -437,4 +430,3 @@ enum hal_status ODM_ConfigBBWithHeaderFile(
>  
>  	return HAL_STATUS_SUCCESS;
>  }
> -
> -- 
> 2.43.0
> 
Re: [PATCH v2] staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c
Posted by Ahmet Sezgin Duran 2 days, 14 hours ago
On 5/22/26 8:04 AM, Diego Fernando Mancera Gómez wrote:
> 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.
> 
> Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
> ---
>   drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 16 ++++------------
>   1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> index c88d669cb086..2e47734a0ae9 100644
> --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> @@ -228,18 +228,11 @@ 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(
> @@ -437,4 +430,3 @@ enum hal_status ODM_ConfigBBWithHeaderFile(
>   
>   	return HAL_STATUS_SUCCESS;
>   }
> -

You need to add list of changes in your commit, as it's V2 right now.

> -	/*
> -	 * 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) {

Why remove comments? Any reasoning?
>   static void odm_Process_RSSIForDM(
> @@ -437,4 +430,3 @@ enum hal_status ODM_ConfigBBWithHeaderFile(
>   
>   	return HAL_STATUS_SUCCESS;
>   }
> 
You also removed a blank line, it's not related to your actual changes. 
It's usually advised to do one type of change in a single commit.

Regards,
Ahmet Sezgin Duran