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 <3chas3@gmail.com>
Cc: linux-atm-general@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kees Cook 2017-10-16 17:29:03 -07:00 коммит произвёл David S. Miller
Родитель 5a3a896203
Коммит 847f03ee16
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -53,7 +53,7 @@ static DEFINE_SPINLOCK(sunis_lock);
if (atomic_read(&stats->s) < 0) atomic_set(&stats->s,INT_MAX); if (atomic_read(&stats->s) < 0) atomic_set(&stats->s,INT_MAX);
static void suni_hz(unsigned long from_timer) static void suni_hz(struct timer_list *timer)
{ {
struct suni_priv *walk; struct suni_priv *walk;
struct atm_dev *dev; struct atm_dev *dev;
@ -85,7 +85,7 @@ static void suni_hz(unsigned long from_timer)
((GET(TACP_TCC) & 0xff) << 8) | ((GET(TACP_TCC) & 0xff) << 8) |
((GET(TACP_TCCM) & 7) << 16)); ((GET(TACP_TCCM) & 7) << 16));
} }
if (from_timer) mod_timer(&poll_timer,jiffies+HZ); if (timer) mod_timer(&poll_timer,jiffies+HZ);
} }
@ -322,13 +322,11 @@ static int suni_start(struct atm_dev *dev)
printk(KERN_WARNING "%s(itf %d): no signal\n",dev->type, printk(KERN_WARNING "%s(itf %d): no signal\n",dev->type,
dev->number); dev->number);
PRIV(dev)->loop_mode = ATM_LM_NONE; PRIV(dev)->loop_mode = ATM_LM_NONE;
suni_hz(0); /* clear SUNI counters */ suni_hz(NULL); /* clear SUNI counters */
(void) fetch_stats(dev,NULL,1); /* clear kernel counters */ (void) fetch_stats(dev,NULL,1); /* clear kernel counters */
if (first) { if (first) {
init_timer(&poll_timer); timer_setup(&poll_timer, suni_hz, 0);
poll_timer.expires = jiffies+HZ; poll_timer.expires = jiffies+HZ;
poll_timer.function = suni_hz;
poll_timer.data = 1;
#if 0 #if 0
printk(KERN_DEBUG "[u] p=0x%lx,n=0x%lx\n",(unsigned long) poll_timer.list.prev, printk(KERN_DEBUG "[u] p=0x%lx,n=0x%lx\n",(unsigned long) poll_timer.list.prev,
(unsigned long) poll_timer.list.next); (unsigned long) poll_timer.list.next);