diff mbox series

rtlwifi: reduce duplicate decision

Message ID 20230212104640.2018995-1-jiconglu58@gmail.com (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show
Series rtlwifi: reduce duplicate decision | expand

Commit Message

Lu jicong Feb. 12, 2023, 10:46 a.m. UTC
This return can go in previous decision.

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/efuse.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Ping-Ke Shih Feb. 13, 2023, 9:20 a.m. UTC | #1
> -----Original Message-----
> From: Lu jicong <jiconglu58@gmail.com>
> Sent: Sunday, February 12, 2023 6:47 PM
> To: Ping-Ke Shih <pkshih@realtek.com>; kvalo@kernel.org; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com
> Cc: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Lu jicong
> <jiconglu58@gmail.com>
> Subject: [PATCH] rtlwifi: reduce duplicate decision

Need "wifi: " prefix.
Subject is too common. How about pointing out 'autoload' or something like that?


> 
> This return can go in previous decision.
> 
> Signed-off-by: Lu jicong <jiconglu58@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/efuse.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c
> b/drivers/net/wireless/realtek/rtlwifi/efuse.c
> index 2e945554ed6d..70c4e22fc426 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
> @@ -1243,14 +1243,12 @@ int rtl_get_hwinfo(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv,
>  		rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING,
>  			"EEPROM ID(%#x) is invalid!!\n", eeprom_id);
>  		rtlefuse->autoload_failflag = true;
> +		return 1;
>  	} else {
>  		rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
>  		rtlefuse->autoload_failflag = false;
>  	}
> 
> -	if (rtlefuse->autoload_failflag)
> -		return 1;
> -

Honestly, I prefer the original version that looks more clear, and we don't need
to stir this chunk.

>  	rtlefuse->eeprom_vid = *(u16 *)&hwinfo[params[1]];
>  	rtlefuse->eeprom_did = *(u16 *)&hwinfo[params[2]];
>  	rtlefuse->eeprom_svid = *(u16 *)&hwinfo[params[3]];
> --
> 2.30.2
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c b/drivers/net/wireless/realtek/rtlwifi/efuse.c
index 2e945554ed6d..70c4e22fc426 100644
--- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
+++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
@@ -1243,14 +1243,12 @@  int rtl_get_hwinfo(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv,
 		rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING,
 			"EEPROM ID(%#x) is invalid!!\n", eeprom_id);
 		rtlefuse->autoload_failflag = true;
+		return 1;
 	} else {
 		rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
 		rtlefuse->autoload_failflag = false;
 	}
 
-	if (rtlefuse->autoload_failflag)
-		return 1;
-
 	rtlefuse->eeprom_vid = *(u16 *)&hwinfo[params[1]];
 	rtlefuse->eeprom_did = *(u16 *)&hwinfo[params[2]];
 	rtlefuse->eeprom_svid = *(u16 *)&hwinfo[params[3]];