net: af_packet: use setup_timer() helper.
authorAllen Pais <allen.lkml@gmail.com>
Mon, 25 Sep 2017 07:30:02 +0000 (13:00 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Sep 2017 20:19:19 +0000 (13:19 -0700)
Use setup_timer function instead of initializing timer with the
function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c

index d288f52c53f7c1b16024e8369663ed4773c517c6..b0f221885dfd90c3294251485a5e2190fc207a9e 100644 (file)
@@ -544,9 +544,7 @@ static void prb_init_blk_timer(struct packet_sock *po,
                struct tpacket_kbdq_core *pkc,
                void (*func) (unsigned long))
 {
-       init_timer(&pkc->retire_blk_timer);
-       pkc->retire_blk_timer.data = (long)po;
-       pkc->retire_blk_timer.function = func;
+       setup_timer(&pkc->retire_blk_timer, func, (long)po);
        pkc->retire_blk_timer.expires = jiffies;
 }