Skip to content

Commit de55558

Browse files
musicakcdavem330
authored andcommitted
forcedeth: Use setup_timer()
Convert a call to init_timer and accompanying intializations of the timer's data and function fields to a call to setup_timer. The Coccinelle semantic patch that fixes this problem is as follows: // <smpl> @@ expression t,f,d; @@ -init_timer(&t); +setup_timer(&t,f,d); -t.data = d; -t.function = f; // </smpl> Signed-off-by: Amitoj Kaur Chawla <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5327ef9 commit de55558

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/net/ethernet/nvidia/forcedeth.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5629,12 +5629,8 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
56295629
u64_stats_init(&np->swstats_rx_syncp);
56305630
u64_stats_init(&np->swstats_tx_syncp);
56315631

5632-
init_timer(&np->oom_kick);
5633-
np->oom_kick.data = (unsigned long) dev;
5634-
np->oom_kick.function = nv_do_rx_refill; /* timer handler */
5635-
init_timer(&np->nic_poll);
5636-
np->nic_poll.data = (unsigned long) dev;
5637-
np->nic_poll.function = nv_do_nic_poll; /* timer handler */
5632+
setup_timer(&np->oom_kick, nv_do_rx_refill, (unsigned long)dev);
5633+
setup_timer(&np->nic_poll, nv_do_nic_poll, (unsigned long)dev);
56385634
init_timer_deferrable(&np->stats_poll);
56395635
np->stats_poll.data = (unsigned long) dev;
56405636
np->stats_poll.function = nv_do_stats_poll; /* timer handler */

0 commit comments

Comments
 (0)