Skip to contentSkip to conversation

mac80211: round station cleanup timer

PATCH New Johannes Berg 1 participant 1 message Dec 17, 2007 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: round station cleanup timer

The station cleanup timer runs every ten seconds, the exact timing is not relevant at all so it can well run together with other things to save power.

---
 net/mac80211/sta_info.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/mac80211/sta_info.c +5 -2
@@ -14,6 +14,7 @@
 #include <linux/slab.h>
 #include <linux/skbuff.h>
 #include <linux/if_arp.h>
+#include <linux/timer.h>
 
 #include <net/mac80211.h>
 #include "ieee80211_i.h"
@@ -312,7 +313,8 @@ static void sta_info_cleanup(unsigned lo
 	}
 	read_unlock_bh(&local->sta_lock);
 
-	local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL;
+	local->sta_cleanup.expires =
+		round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
 	add_timer(&local->sta_cleanup);
 }
 
@@ -351,7 +353,8 @@ void sta_info_init(struct ieee80211_loca
 	INIT_LIST_HEAD(&local->sta_list);
 
 	init_timer(&local->sta_cleanup);
-	local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL;
+	local->sta_cleanup.expires =
+		round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
 	local->sta_cleanup.data = (unsigned long) local;
 	local->sta_cleanup.function = sta_info_cleanup;