Author: simon Date: 2010-04-19 23:14:19 +0200 (Mon, 19 Apr 2010) New Revision: 1638
Modified: trunk/batman-adv-kernelland/main.c trunk/batman-adv-kernelland/main.h trunk/batman-adv-kernelland/vis.c Log: batman-adv: convert vis_interval into define
vis_interval does not neccesarily needs to be a variable, as there is no way to change it anyway (and probably no need to). We can therefore remove yet another global variable.
Thanks Marek for pointing this out.
Signed-off-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
Modified: trunk/batman-adv-kernelland/main.c =================================================================== --- trunk/batman-adv-kernelland/main.c 2010-04-19 20:13:31 UTC (rev 1637) +++ trunk/batman-adv-kernelland/main.c 2010-04-19 21:14:19 UTC (rev 1638) @@ -43,8 +43,6 @@ DEFINE_SPINLOCK(forw_bat_list_lock); DEFINE_SPINLOCK(forw_bcast_list_lock);
-atomic_t vis_interval; - int16_t num_hna;
struct net_device *soft_device; @@ -80,9 +78,6 @@
atomic_set(&module_state, MODULE_INACTIVE);
- atomic_set(&vis_interval, 1000);/* TODO: raise this later, this is only - * for debugging now. */ - /* the name should not be longer than 10 chars - see * http://lwn.net/Articles/23634/ */ bat_event_workqueue = create_singlethread_workqueue("bat_events");
Modified: trunk/batman-adv-kernelland/main.h =================================================================== --- trunk/batman-adv-kernelland/main.h 2010-04-19 20:13:31 UTC (rev 1637) +++ trunk/batman-adv-kernelland/main.h 2010-04-19 21:14:19 UTC (rev 1638) @@ -56,6 +56,8 @@ #define LOG_BUF_LEN 8192 /* has to be a power of 2 */ #define ETH_STR_LEN 20
+#define VIS_INTERVAL 5000 /* 5 seconds */ + /* how much worse secondary interfaces may be to * to be considered as bonding candidates */
@@ -137,7 +139,6 @@ extern spinlock_t forw_bat_list_lock; extern spinlock_t forw_bcast_list_lock;
-extern atomic_t vis_interval; extern int16_t num_hna;
extern struct net_device *soft_device;
Modified: trunk/batman-adv-kernelland/vis.c =================================================================== --- trunk/batman-adv-kernelland/vis.c 2010-04-19 20:13:31 UTC (rev 1637) +++ trunk/batman-adv-kernelland/vis.c 2010-04-19 21:14:19 UTC (rev 1638) @@ -702,7 +702,7 @@ }
/* prefill the vis info */ - my_vis_info->first_seen = jiffies - atomic_read(&vis_interval); + my_vis_info->first_seen = jiffies - msecs_to_jiffies(VIS_INTERVAL); INIT_LIST_HEAD(&my_vis_info->recv_list); INIT_LIST_HEAD(&my_vis_info->send_list); kref_init(&my_vis_info->refcount); @@ -765,5 +765,5 @@ static void start_vis_timer(void) { queue_delayed_work(bat_event_workqueue, &vis_timer_wq, - (atomic_read(&vis_interval) * HZ) / 1000); + (VIS_INTERVAL * HZ) / 1000); }