提交 e6dc269b 编写于 作者: S Simon Wunderlich 提交者: Greg Kroah-Hartman

Staging: 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: NSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
[sven.eckelmann@gmx.de: Rework on top of current version]
Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8af60a8c
...@@ -41,7 +41,6 @@ DEFINE_SPINLOCK(orig_hash_lock); ...@@ -41,7 +41,6 @@ DEFINE_SPINLOCK(orig_hash_lock);
DEFINE_SPINLOCK(forw_bat_list_lock); DEFINE_SPINLOCK(forw_bat_list_lock);
DEFINE_SPINLOCK(forw_bcast_list_lock); DEFINE_SPINLOCK(forw_bcast_list_lock);
atomic_t vis_interval;
atomic_t bcast_queue_left; atomic_t bcast_queue_left;
atomic_t batman_queue_left; atomic_t batman_queue_left;
...@@ -80,8 +79,6 @@ int init_module(void) ...@@ -80,8 +79,6 @@ int init_module(void)
atomic_set(&module_state, MODULE_INACTIVE); atomic_set(&module_state, MODULE_INACTIVE);
atomic_set(&vis_interval, 1000);/* TODO: raise this later, this is only
* for debugging now. */
atomic_set(&bcast_queue_left, BCAST_QUEUE_LEN); atomic_set(&bcast_queue_left, BCAST_QUEUE_LEN);
atomic_set(&batman_queue_left, BATMAN_QUEUE_LEN); atomic_set(&batman_queue_left, BATMAN_QUEUE_LEN);
......
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
#define LOG_BUF_LEN 8192 /* has to be a power of 2 */ #define LOG_BUF_LEN 8192 /* has to be a power of 2 */
#define ETH_STR_LEN 20 #define ETH_STR_LEN 20
#define VIS_INTERVAL 5000 /* 5 seconds */
#define MAX_AGGREGATION_BYTES 512 /* should not be bigger than 512 bytes or #define MAX_AGGREGATION_BYTES 512 /* should not be bigger than 512 bytes or
* change the size of * change the size of
* forw_packet->direct_link_flags */ * forw_packet->direct_link_flags */
...@@ -134,7 +136,6 @@ extern spinlock_t orig_hash_lock; ...@@ -134,7 +136,6 @@ extern spinlock_t orig_hash_lock;
extern spinlock_t forw_bat_list_lock; extern spinlock_t forw_bat_list_lock;
extern spinlock_t forw_bcast_list_lock; extern spinlock_t forw_bcast_list_lock;
extern atomic_t vis_interval;
extern atomic_t bcast_queue_left; extern atomic_t bcast_queue_left;
extern atomic_t batman_queue_left; extern atomic_t batman_queue_left;
extern int16_t num_hna; extern int16_t num_hna;
......
...@@ -701,7 +701,7 @@ int vis_init(void) ...@@ -701,7 +701,7 @@ int vis_init(void)
} }
/* prefill the vis info */ /* 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->recv_list);
INIT_LIST_HEAD(&my_vis_info->send_list); INIT_LIST_HEAD(&my_vis_info->send_list);
kref_init(&my_vis_info->refcount); kref_init(&my_vis_info->refcount);
...@@ -764,5 +764,5 @@ void vis_quit(void) ...@@ -764,5 +764,5 @@ void vis_quit(void)
static void start_vis_timer(void) static void start_vis_timer(void)
{ {
queue_delayed_work(bat_event_workqueue, &vis_timer_wq, queue_delayed_work(bat_event_workqueue, &vis_timer_wq,
(atomic_read(&vis_interval) * HZ) / 1000); (VIS_INTERVAL * HZ) / 1000);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册