Skip to content

Commit 8bd811a

Browse files
zhao-gangjmberg-intel
authored andcommitted
mac80211: change return value of notifier function
Return NOTIFY_DONE if we don't care this time's notification, return NOTIFY_OK if we successfully handled this time's notification. That's the formal way to do it. Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 6784c7d commit 8bd811a

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎net/mac80211/iface.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,20 +1787,19 @@ static int netdev_notify(struct notifier_block *nb,
17871787
struct ieee80211_sub_if_data *sdata;
17881788

17891789
if (state != NETDEV_CHANGENAME)
1790-
return 0;
1790+
return NOTIFY_DONE;
17911791

17921792
if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy)
1793-
return 0;
1793+
return NOTIFY_DONE;
17941794

17951795
if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid)
1796-
return 0;
1796+
return NOTIFY_DONE;
17971797

17981798
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1799-
18001799
memcpy(sdata->name, dev->name, IFNAMSIZ);
1801-
18021800
ieee80211_debugfs_rename_netdev(sdata);
1803-
return 0;
1801+
1802+
return NOTIFY_OK;
18041803
}
18051804

18061805
static struct notifier_block mac80211_netdev_notifier = {

‎net/mac80211/main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
338338

339339
sdata_unlock(sdata);
340340

341-
return NOTIFY_DONE;
341+
return NOTIFY_OK;
342342
}
343343
#endif
344344

@@ -369,7 +369,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb,
369369

370370
drv_ipv6_addr_change(local, sdata, idev);
371371

372-
return NOTIFY_DONE;
372+
return NOTIFY_OK;
373373
}
374374
#endif
375375

‎net/mac80211/mlme.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3701,7 +3701,7 @@ int ieee80211_max_network_latency(struct notifier_block *nb,
37013701
ieee80211_recalc_ps(local, latency_usec);
37023702
mutex_unlock(&local->iflist_mtx);
37033703

3704-
return 0;
3704+
return NOTIFY_OK;
37053705
}
37063706

37073707
static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata,

0 commit comments

Comments
 (0)