From: Andrew Morton <akpm@linux-foundation.org>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-kernel@vger.kernel.org,
"Michael H. Warfield" <mhw@wittsend.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] ip2: avoid add_timer() with pending timer
Date: Mon, 14 Jul 2008 10:04:02 -0700 [thread overview]
Message-ID: <20080714100402.b72e2b1e.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080714024955.GB30952@sssvn.sssvn>
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.
next prev parent reply other threads:[~2008-07-14 17:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-14 2:49 [PATCH] ip2: avoid add_timer() with pending timer Akinobu Mita
2008-07-14 13:33 ` Alan Cox
2008-07-14 17:04 ` Andrew Morton [this message]
2008-07-15 3:06 ` Akinobu Mita
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080714100402.b72e2b1e.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=akinobu.mita@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mhw@wittsend.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox