Skip to contentSkip to conversation

wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link()

PATCH Superseded Lukas Bulwahn 2 participants 3 messages Aug 12, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mac80211: clean up a needless assignment in ieee80211_sta_activate_link()

Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion") makes ieee80211_sta_activate_link() return 0 in the 'hash' label case. Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed anymore and can be dropped.

Remove a needless assignment.

No functional change. No change in object code.

---
 net/mac80211/sta_info.c | 1 -
 1 file changed, 1 deletion(-)
net/mac80211/sta_info.c +0 -1
index cb23da9aff1e..492c7a29d797 100644
@@ -2778,7 +2778,6 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
 	sta->sta.valid_links = new_links;
 
 	if (!test_sta_flag(sta, WLAN_STA_INSERTED)) {
-		ret = 0;
 		goto hash;
 	}
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 19 lines · Lukas Bulwahn

Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion") makes ieee80211_sta_activate_link() return 0 in the 'hash' label case. Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed anymore and can be dropped.

Remove a needless assignment.

No functional change. No change in object code.

---
 net/mac80211/sta_info.c | 1 -
 1 file changed, 1 deletion(-)
net/mac80211/sta_info.c +0 -0
index cb23da9aff1e..492c7a29d797 100644

net/mac80211/sta_info.c int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id) · line 2782

Quoted 6 lines
net/mac80211/sta_info.c +0 -1
@@ -2778,7 +2778,6 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
 	sta->sta.valid_links = new_links;
 
 	if (!test_sta_flag(sta, WLAN_STA_INSERTED)) {
-		ret = 0;
 		goto hash;
 	}

Please, remove the {} as well.

regards,
dan carpenter

#2 lore raw
Quoted 23 lines · Dan Carpenter
Quoted 21 lines · Lukas Bulwahn

Commit 177577dbd223 ("wifi: mac80211: sta_info: fix link_sta insertion") makes ieee80211_sta_activate_link() return 0 in the 'hash' label case. Hence, setting ret in the !test_sta_flag(...) branch to zero is not needed anymore and can be dropped.

Remove a needless assignment.

No functional change. No change in object code.

---
 net/mac80211/sta_info.c | 1 -
 1 file changed, 1 deletion(-)
net/mac80211/sta_info.c +0 -0
index cb23da9aff1e..492c7a29d797 100644
@@ -2778,7 +2778,6 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
      sta->sta.valid_links = new_links;
 
Quoted 7 lines

net/mac80211/sta_info.c int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id) · line 2782

Quoted 4 lines
net/mac80211/sta_info.c +0 -1
      if (!test_sta_flag(sta, WLAN_STA_INSERTED)) {
-             ret = 0;
              goto hash;
      }

Please, remove the {} as well.

Thanks for the pointer, Dan! I need to remember that for the future; I did expect checkpatch to warn me of such a stylistic pattern, but it seems that it does not. So I just need to have an eye on that.

Patch v2 sent out:
https://lore.kernel.org/lkml/[email protected]/

Lukas