Skip to contentSkip to conversation

net: wireless: ath: ath9k: remove unnecessary code

PATCH In review Gustavo A. R. Silva 2 participants 5 messages May 9, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: wireless: ath: ath9k: remove unnecessary code

The name of an array used by itself will always return the array's address. So this test will always evaluate as true.

Addresses-Coverity-ID: 1364903

---
 drivers/net/wireless/ath/ath9k/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/eeprom.c +1 -1
index fb80ec8..5c3bc28 100644
@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
 
 	if (ah->eeprom_blob)
 		ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
-	else if (pdata && !pdata->use_eeprom && pdata->eeprom_data)
+	else if (pdata && !pdata->use_eeprom)
 		ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
 	else
 		ret = common->bus_ops->eeprom_read(common, off, data);
Signature · 1 line
2.5.0
#1 lore raw
Quoted 14 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So this test will always evaluate as true.

Addresses-Coverity-ID: 1364903

---
 drivers/net/wireless/ath/ath9k/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/eeprom.c +0 -0
index fb80ec8..5c3bc28 100644

drivers/net/wireless/ath/ath9k/eeprom.c bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data) · line 149

Quoted 8 lines
drivers/net/wireless/ath/ath9k/eeprom.c +1 -1
@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
 
 	if (ah->eeprom_blob)
 		ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
-	else if (pdata && !pdata->use_eeprom && pdata->eeprom_data)
+	else if (pdata && !pdata->use_eeprom)
 		ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
 	else
 		ret = common->bus_ops->eeprom_read(common, off, data);

The patch may very well be valid (didn't check yet) but the commit log is gibberish for me.

Signature · 1 line
Kalle Valo
#2 lore raw

Hi Kalle,

Quoting Kalle Valo <[email protected]>:

Quoted 18 lines
Quoted 16 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So this test will always evaluate as true.

Addresses-Coverity-ID: 1364903

---
 drivers/net/wireless/ath/ath9k/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/eeprom.c +0 -0
index fb80ec8..5c3bc28 100644
@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32  
 off, u16 *data)
 
Quoted 11 lines
Quoted 7 lines
drivers/net/wireless/ath/ath9k/eeprom.c +1 -1
 	if (ah->eeprom_blob)
 		ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
-	else if (pdata && !pdata->use_eeprom && pdata->eeprom_data)
+	else if (pdata && !pdata->use_eeprom)
 		ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
 	else

ret = common->bus_ops->eeprom_read(common, off, data);

The patch may very well be valid (didn't check yet) but the commit log is gibberish for me.

Let me correct that and I'll send the patch again.

Thanks!
--
Gustavo A. R. Silva

#3 lore raw
Quoted 35 lines · Gustavo A. R. Silva

Hi Kalle,

Quoting Kalle Valo <[email protected]>:

Quoted 19 lines
Quoted 17 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So this test will always evaluate as true.

Addresses-Coverity-ID: 1364903

---
 drivers/net/wireless/ath/ath9k/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/eeprom.c +0 -0
index fb80ec8..5c3bc28 100644
@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32
 off, u16 *data)
 
Quoted 11 lines
Quoted 7 lines
drivers/net/wireless/ath/ath9k/eeprom.c +1 -1
 	if (ah->eeprom_blob)
 		ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
-	else if (pdata && !pdata->use_eeprom && pdata->eeprom_data)
+	else if (pdata && !pdata->use_eeprom)
 		ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
 	else

ret = common->bus_ops->eeprom_read(common, off, data);

The patch may very well be valid (didn't check yet) but the commit log is gibberish for me.

Quoted 1 line

Let me correct that and I'll send the patch again.

Thanks.

Also no need to have that long "net: wireless: ath:" prefix, "ath9k: " or "ath10k: " is enough.

Signature · 1 line
Kalle Valo
#4 lore raw

Quoting Kalle Valo <[email protected]>:

Quoted 37 lines
Quoted 35 lines · Gustavo A. R. Silva

Hi Kalle,

Quoting Kalle Valo <[email protected]>:

Quoted 30 lines
Quoted 23 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So this test will always evaluate as true.

Addresses-Coverity-ID: 1364903

---
 drivers/net/wireless/ath/ath9k/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/eeprom.c +1 -1
index fb80ec8..5c3bc28 100644
@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32
 off, u16 *data)
 
 	if (ah->eeprom_blob)
 		ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
-	else if (pdata && !pdata->use_eeprom && pdata->eeprom_data)
+	else if (pdata && !pdata->use_eeprom)
 		ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
 	else
Quoted 1 line

ret = common->bus_ops->eeprom_read(common, off, data);

The patch may very well be valid (didn't check yet) but the commit log is gibberish for me.

Quoted 7 lines
Quoted 1 line

Let me correct that and I'll send the patch again.

Thanks.

Also no need to have that long "net: wireless: ath:" prefix, "ath9k: " or "ath10k: " is enough.

I get it.

Thanks!
--
Gustavo A. R. Silva