summaryrefslogtreecommitdiffstats
path: root/net/tipc/monitor.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-30 22:06:45 +0100
committerDavid S. Miller <davem@davemloft.net>2017-11-01 04:38:45 +0100
commit31b102bb501bea50ebc10f4aecf9d788305b8b87 (patch)
treef89a272ba7cd7bd71fe6ffdbb966d30e66cd12de /net/tipc/monitor.c
parentdrivers/net: tundra: Convert timers to use timer_setup() (diff)
downloadlinux-31b102bb501bea50ebc10f4aecf9d788305b8b87.tar.xz
linux-31b102bb501bea50ebc10f4aecf9d788305b8b87.zip
net: tipc: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jon Maloy <jon.maloy@ericsson.com> Cc: Ying Xue <ying.xue@windriver.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: netdev@vger.kernel.org Cc: tipc-discussion@lists.sourceforge.net Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/monitor.c')
-rw-r--r--net/tipc/monitor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index 9e109bb1a207..b9c32557d73c 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -578,9 +578,9 @@ void tipc_mon_get_state(struct net *net, u32 addr,
read_unlock_bh(&mon->lock);
}
-static void mon_timeout(unsigned long m)
+static void mon_timeout(struct timer_list *t)
{
- struct tipc_monitor *mon = (void *)m;
+ struct tipc_monitor *mon = from_timer(mon, t, timer);
struct tipc_peer *self;
int best_member_cnt = dom_size(mon->peer_cnt) - 1;
@@ -623,7 +623,7 @@ int tipc_mon_create(struct net *net, int bearer_id)
self->is_up = true;
self->is_head = true;
INIT_LIST_HEAD(&self->list);
- setup_timer(&mon->timer, mon_timeout, (unsigned long)mon);
+ timer_setup(&mon->timer, mon_timeout, 0);
mon->timer_intv = msecs_to_jiffies(MON_TIMEOUT + (tn->random & 0xffff));
mod_timer(&mon->timer, jiffies + mon->timer_intv);
return 0;