Skip to contentSkip to conversation

staging: rtlwifi: Remove an extra pair of braces

PATCH In review Maya Nakamura 2 participants 3 messages Oct 21, 2018 – Oct 23, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtlwifi: Remove an extra pair of braces

Remove an extra pair of braces. Issue found while reviewing one of Coccinelle's semantic patch results for returnvar.cocci.

---
 drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +1 -3
index 4bf86e5a451f..90a41c64c0c2 100644
@@ -484,9 +484,7 @@ static u8 odm_query_rx_pwr_percentage(s8 ant_power)
 
 s32 odm_signal_scale_mapping(struct phy_dm_struct *dm, s32 curr_sig)
 {
-	{
-		return curr_sig;
-	}
+	return curr_sig;
 }
 
 static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm,
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 13 lines · Maya Nakamura

Remove an extra pair of braces. Issue found while reviewing one of Coccinelle's semantic patch results for returnvar.cocci.

---
 drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0 -0
index 4bf86e5a451f..90a41c64c0c2 100644

drivers/staging/rtlwifi/phydm/phydm_hwconfig.c static u8 odm_query_rx_pwr_percentage(s8 ant_power) · line 488

Quoted 8 lines
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +1 -3
@@ -484,9 +484,7 @@ static u8 odm_query_rx_pwr_percentage(s8 ant_power)
 
 s32 odm_signal_scale_mapping(struct phy_dm_struct *dm, s32 curr_sig)
 {
-	{
-		return curr_sig;
-	}
+	return curr_sig;
 }

Why is this function needed at all? Can't it just be removed and only use the curr_sig parameter where it is called?

thanks,

greg k-h

#2 lore raw
Quoted 27 lines · Greg KH
Quoted 13 lines · Maya Nakamura

Remove an extra pair of braces. Issue found while reviewing one of Coccinelle's semantic patch results for returnvar.cocci.

---
 drivers/staging/rtlwifi/phydm/phydm_hwconfig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +0 -0
index 4bf86e5a451f..90a41c64c0c2 100644

drivers/staging/rtlwifi/phydm/phydm_hwconfig.c static u8 odm_query_rx_pwr_percentage(s8 ant_power) · line 488

Quoted 8 lines
drivers/staging/rtlwifi/phydm/phydm_hwconfig.c +1 -3
@@ -484,9 +484,7 @@ static u8 odm_query_rx_pwr_percentage(s8 ant_power)
 
 s32 odm_signal_scale_mapping(struct phy_dm_struct *dm, s32 curr_sig)
 {
-	{
-		return curr_sig;
-	}
+	return curr_sig;
 }

Why is this function needed at all? Can't it just be removed and only use the curr_sig parameter where it is called?

Quoted 3 lines

thanks,

greg k-h

Thank you for suggesting further changes to the file! As you pointed out, I can modify where the specific function is called (five places) and remove the function's declaration/definition. I will submit a new patch.

Maya