From: Johannes Berg Date: Fri, 1 Feb 2013 00:04:14 +0000 (+0100) Subject: cfg80211: move locking into cfg80211_bss_age X-Git-Tag: submit/tizen/20141203.153721~2684^2~28^2^2~26^2~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ca813ad61136896c91a40194452ff665a522711;p=platform%2Fkernel%2Flinux-arm64.git cfg80211: move locking into cfg80211_bss_age There's no reason for it to require external locking, move it into the function. Signed-off-by: Johannes Berg --- diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 34b47b30be8..1494d947e8d 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -231,15 +231,16 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev, return 0; } -/* must hold dev->bss_lock! */ void cfg80211_bss_age(struct cfg80211_registered_device *dev, unsigned long age_secs) { struct cfg80211_internal_bss *bss; unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); + spin_lock_bh(&dev->bss_lock); list_for_each_entry(bss, &dev->bss_list, list) bss->ts -= age_jiffies; + spin_unlock_bh(&dev->bss_lock); } void cfg80211_bss_expire(struct cfg80211_registered_device *dev) diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index 9bf6d5e3216..73bf39f1131 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c @@ -108,9 +108,7 @@ static int wiphy_resume(struct device *dev) int ret = 0; /* Age scan results with time spent in suspend */ - spin_lock_bh(&rdev->bss_lock); cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at); - spin_unlock_bh(&rdev->bss_lock); if (rdev->ops->resume) { rtnl_lock();