Skip to content

Commit

Permalink
atm: horizon: Use setup_timer
Browse files Browse the repository at this point in the history
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:
@@
expression t,d,f,e1;
identifier x1;
statement S1;
@@

(
-t.data = d;
|
-t.function = f;
|
-init_timer(&t);
+setup_timer(&t,f,d);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,d);
)
<... when != S1
t.x1 = e1;
...>

Signed-off-by: Amitoj Kaur Chawla <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
musicakc authored and davem330 committed Jul 1, 2016
1 parent e3cc6e3 commit 466fc79
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/atm/horizon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2795,9 +2795,7 @@ static int hrz_probe(struct pci_dev *pci_dev,
dev->atm_dev->ci_range.vpi_bits = vpi_bits;
dev->atm_dev->ci_range.vci_bits = 10-vpi_bits;

init_timer(&dev->housekeeping);
dev->housekeeping.function = do_housekeeping;
dev->housekeeping.data = (unsigned long) dev;
setup_timer(&dev->housekeeping, do_housekeeping, (unsigned long) dev);
mod_timer(&dev->housekeeping, jiffies);

out:
Expand Down

0 comments on commit 466fc79

Please sign in to comment.