Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
mac80211: change return value of notifier function
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
zhao-gang authored and jmberg-intel committed Apr 25, 2014
1 parent 6784c7d commit 8bd811a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,20 +1787,19 @@ static int netdev_notify(struct notifier_block *nb,
struct ieee80211_sub_if_data *sdata;

if (state != NETDEV_CHANGENAME)
return 0;
return NOTIFY_DONE;

if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy)
return 0;
return NOTIFY_DONE;

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

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

memcpy(sdata->name, dev->name, IFNAMSIZ);

ieee80211_debugfs_rename_netdev(sdata);
return 0;

return NOTIFY_OK;
}

static struct notifier_block mac80211_netdev_notifier = {
Expand Down
4 changes: 2 additions & 2 deletions net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,

sdata_unlock(sdata);

return NOTIFY_DONE;
return NOTIFY_OK;
}
#endif

Expand Down Expand Up @@ -369,7 +369,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb,

drv_ipv6_addr_change(local, sdata, idev);

return NOTIFY_DONE;
return NOTIFY_OK;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -3701,7 +3701,7 @@ int ieee80211_max_network_latency(struct notifier_block *nb,
ieee80211_recalc_ps(local, latency_usec);
mutex_unlock(&local->iflist_mtx);

return 0;
return NOTIFY_OK;
}

static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata,
Expand Down

0 comments on commit 8bd811a

Please sign in to comment.