Skip to content

Commit 847f03e

Browse files
keesdavem330
authored andcommitted
drivers/atm/suni: 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. Passes NULL timer when doing non- timer call. Cc: Chas Williams <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5a3a896 commit 847f03e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/atm/suni.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static DEFINE_SPINLOCK(sunis_lock);
5353
if (atomic_read(&stats->s) < 0) atomic_set(&stats->s,INT_MAX);
5454

5555

56-
static void suni_hz(unsigned long from_timer)
56+
static void suni_hz(struct timer_list *timer)
5757
{
5858
struct suni_priv *walk;
5959
struct atm_dev *dev;
@@ -85,7 +85,7 @@ static void suni_hz(unsigned long from_timer)
8585
((GET(TACP_TCC) & 0xff) << 8) |
8686
((GET(TACP_TCCM) & 7) << 16));
8787
}
88-
if (from_timer) mod_timer(&poll_timer,jiffies+HZ);
88+
if (timer) mod_timer(&poll_timer,jiffies+HZ);
8989
}
9090

9191

@@ -322,13 +322,11 @@ static int suni_start(struct atm_dev *dev)
322322
printk(KERN_WARNING "%s(itf %d): no signal\n",dev->type,
323323
dev->number);
324324
PRIV(dev)->loop_mode = ATM_LM_NONE;
325-
suni_hz(0); /* clear SUNI counters */
325+
suni_hz(NULL); /* clear SUNI counters */
326326
(void) fetch_stats(dev,NULL,1); /* clear kernel counters */
327327
if (first) {
328-
init_timer(&poll_timer);
328+
timer_setup(&poll_timer, suni_hz, 0);
329329
poll_timer.expires = jiffies+HZ;
330-
poll_timer.function = suni_hz;
331-
poll_timer.data = 1;
332330
#if 0
333331
printk(KERN_DEBUG "[u] p=0x%lx,n=0x%lx\n",(unsigned long) poll_timer.list.prev,
334332
(unsigned long) poll_timer.list.next);

0 commit comments

Comments
 (0)