lkml.org 
[lkml]   [2008]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ip2: avoid add_timer() with pending timer
On Mon, 14 Jul 2008 11:49:55 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:

> @@ -746,10 +742,8 @@ ip2_loadmain(int *iop, int *irqp)
> }
> if ( ip2config.irq[i] == CIR_POLL ) {
> retry:
> - if (!TimerOn) {
> - PollTimer.expires = POLL_TIMEOUT;
> - add_timer ( &PollTimer );
> - TimerOn = 1;
> + if (!timer_pending(&PollTimer)) {
> + mod_timer(&PollTimer, POLL_TIMEOUT);
> printk( KERN_INFO "IP2: polling\n");

This change to ip2_loadmain() might be racy if it actually did
anything. But afaict timer_pending() can never be true here (we're
only called from module_init()) so it can and should be removed.



\
 
 \ /
  Last update: 2008-07-14 19:07    [W:0.041 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site