drop_monitor: use setup_timer
authorGeliang Tang <geliangtang@gmail.com>
Sat, 11 Mar 2017 00:46:59 +0000 (08:46 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 06:47:16 +0000 (23:47 -0700)
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/drop_monitor.c

index fb55327dcfeabdaf3eeecc3a8d176ae215612649..70ccda233bd1f1aab18535e6d9d0419bb9a1a23b 100644 (file)
@@ -412,9 +412,8 @@ static int __init init_net_drop_monitor(void)
        for_each_possible_cpu(cpu) {
                data = &per_cpu(dm_cpu_data, cpu);
                INIT_WORK(&data->dm_alert_work, send_dm_alert);
-               init_timer(&data->send_timer);
-               data->send_timer.data = (unsigned long)data;
-               data->send_timer.function = sched_send_work;
+               setup_timer(&data->send_timer, sched_send_work,
+                           (unsigned long)data);
                spin_lock_init(&data->lock);
                reset_per_cpu_data(data);
        }