Skip to contentSkip to conversation

rtlwifi: rtl8192ee: Remove redundant initialization of variable version

PATCH In review Colin King 3 participants 3 messages Oct 7, 2021 – Oct 13, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 rtlwifi: rtl8192ee: Remove redundant initialization of variable version

From: Colin Ian King <[email protected]>

The variable version is being initialized with a value that is never read, it is being updated afterwards in both branches of an if statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c +1 -1
index 88fa2e593fef..76189283104c 100644
@@ -1430,7 +1430,7 @@ static enum version_8192e _rtl92ee_read_chip_version(struct ieee80211_hw *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_phy *rtlphy = &rtlpriv->phy;
-	enum version_8192e version = VERSION_UNKNOWN;
+	enum version_8192e version;
 	u32 value32;
 
 	rtlphy->rf_type = RF_2T2R;
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 41 lines

-----Original Message-----
From: Colin King <[email protected]>
Sent: Friday, October 8, 2021 12:37 AM
To: Pkshih <[email protected]>; Kalle Valo <[email protected]>; David S . Miller <[email protected]>; Jakub Kicinski <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] rtlwifi: rtl8192ee: Remove redundant initialization of variable version

From: Colin Ian King <[email protected]>

The variable version is being initialized with a value that is never read, it is being updated afterwards in both branches of an if statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c +1 -1
index 88fa2e593fef..76189283104c 100644
@@ -1430,7 +1430,7 @@ static enum version_8192e _rtl92ee_read_chip_version(struct ieee80211_hw
 *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_phy *rtlphy = &rtlpriv->phy;
-	enum version_8192e version = VERSION_UNKNOWN;
+	enum version_8192e version;
 	u32 value32;
 

rtlphy->rf_type = RF_2T2R;
--
2.32.0

Quoted 1 line

------Please consider the environment before printing this e-mail.

#2 lore raw
In reply to Colin King
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The variable version is being initialized with a value that is never read, it is being updated afterwards in both branches of an if statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Patch applied to wireless-drivers-next.git, thanks.

51fd5c6417b9 rtlwifi: rtl8192ee: Remove redundant initialization of variable version

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches