Skip to contentSkip to conversation

mt76: fix compilation warning in mt76_eeprom_override()

PATCH In review Lorenzo Bianconi 2 participants 4 messages Dec 16, 2019 – Dec 18, 2019

Subsystems (2)
lore
Share & tools
lore

Lorenzo Bianconi

author maintainer
#0 lore raw

PATCH 1/1 mt76: fix compilation warning in mt76_eeprom_override()

Fix the following compilation warning in mt76_eeprom_override routine when CONFIG_OF is not set and label 'out' is not actually used

drivers/net/wireless/mediatek/mt76/eeprom.c: In function ‘mt76_eeprom_override’:
drivers/net/wireless/mediatek/mt76/eeprom.c:100:1: warning: label ‘out’ defined but not used [-Wunused-label]

---
 drivers/net/wireless/mediatek/mt76/eeprom.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/wireless/mediatek/mt76/eeprom.c +4 -7
index 8f2693748faf..c236e303ccfd 100644
@@ -87,17 +87,14 @@ mt76_eeprom_override(struct mt76_dev *dev)
 {
 #ifdef CONFIG_OF
 	struct device_node *np = dev->dev->of_node;
-	const u8 *mac;
+	const u8 *mac = NULL;
 
-	if (!np)
-		goto out;
-
-	mac = of_get_mac_address(np);
-	if (!IS_ERR(mac))
+	if (np)
+		mac = of_get_mac_address(np);
+	if (!IS_ERR_OR_NULL(mac))
 		ether_addr_copy(dev->macaddr, mac);
 #endif
 
-out:
 	if (!is_valid_ether_addr(dev->macaddr)) {
 		eth_random_addr(dev->macaddr);
 		dev_info(dev->dev,
Signature · 1 line
2.21.0
#1 lore raw
Quoted 7 lines · Lorenzo Bianconi

Fix the following compilation warning in mt76_eeprom_override routine when CONFIG_OF is not set and label 'out' is not actually used

drivers/net/wireless/mediatek/mt76/eeprom.c: In function ‘mt76_eeprom_override’:
drivers/net/wireless/mediatek/mt76/eeprom.c:100:1: warning: label ‘out’ defined but not used [-Wunused-label]

What commit introduced this? Or is this an old issue?

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
author maintainer
#2 lore raw
Quoted 11 lines
Quoted 7 lines · Lorenzo Bianconi

Fix the following compilation warning in mt76_eeprom_override routine when CONFIG_OF is not set and label 'out' is not actually used

drivers/net/wireless/mediatek/mt76/eeprom.c: In function ‘mt76_eeprom_override’:
drivers/net/wireless/mediatek/mt76/eeprom.c:100:1: warning: label ‘out’ defined but not used [-Wunused-label]

What commit introduced this? Or is this an old issue?

Hi Kalle,

I did not added the Fixed tag since this commit is currently just on Felix's tree:

commit c203e25590b472eb561e1c53898a7f7b5c734563
mt76: fix possible undetected invalid MAC address

Regards,
Lorenzo

Quoted 3 lines
Signature · 2 lines
-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw
Quoted 11 lines · Lorenzo Bianconi
Quoted 11 lines
Quoted 8 lines · Lorenzo Bianconi

Fix the following compilation warning in mt76_eeprom_override routine when CONFIG_OF is not set and label 'out' is not actually used

drivers/net/wireless/mediatek/mt76/eeprom.c: In function ‘mt76_eeprom_override’:
drivers/net/wireless/mediatek/mt76/eeprom.c:100:1: warning: label ‘out’ defined but not used [-Wunused-label]

Quoted 8 lines
Quoted 1 line

What commit introduced this? Or is this an old issue?

Hi Kalle,

I did not added the Fixed tag since this commit is currently just on Felix's tree:

commit c203e25590b472eb561e1c53898a7f7b5c734563
mt76: fix possible undetected invalid MAC address

Ok, so no need to push to wireless-drivers then.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches