All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Corentin Labbe <clabbe.montjoie@gmail.com>, arnd@arndb.de
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/6] hpet: removing unused variable m in hpet_interrupt
Date: Mon, 3 Apr 2017 14:55:14 +0200	[thread overview]
Message-ID: <64bd824c-2d09-3c8c-d35d-06d3808713b2@ladisch.de> (raw)
In-Reply-To: <20170403121559.1397-6-clabbe.montjoie@gmail.com>

Corentin Labbe wrote:
> This patch fix the following warning:
> drivers/char/hpet.c:146:17: attention : variable ‘m’ set but not used [-Wunused-but-set-variable]
> by removing the unused variable m in hpet_interrupt

This patch might silence the warning, but it leaves the bug that
actually caused the warning.

As far as I can see, the computation of "base" should use "m".

But the entire algorithm is completely bogus because it does not
actually remove the race condition; the counter is likely to have
advanced beyond the "mc" value when the new comparator value is
written.  Also see arch/x86/kernel/hpet.c for how hpet_next_event()
handles this.

And why a non-periodic timer should generate periodic interrupts is
another question.

And nobody uses this crap.
So I'm really not sure what to do about this ...


Regards,
Clemens

  reply	other threads:[~2017-04-03 13:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 12:15 [PATCH v2 0/6] hpet: fix build warnings and style Corentin Labbe
2017-04-03 12:15 ` [PATCH v2 1/6] hpet: remove unused variable hpet in hpet_ioctl_common Corentin Labbe
2017-04-03 12:15 ` [PATCH v2 2/6] hpet: remove unused writeq/readq function definitions Corentin Labbe
2017-04-03 12:15 ` [PATCH v2 3/6] hpet: fix checkpatch complains about spaces Corentin Labbe
2017-04-03 12:15 ` [PATCH v2 4/6] hpet: replace printk by their pr_xxx counterparts Corentin Labbe
2017-04-03 19:44   ` Joe Perches
2017-04-03 12:15 ` [PATCH v2 5/6] hpet: removing unused variable m in hpet_interrupt Corentin Labbe
2017-04-03 12:55   ` Clemens Ladisch [this message]
2017-04-03 12:15 ` [PATCH v2 6/6] hpet: fix style issue about braces and alignment Corentin Labbe
2017-04-04  3:43   ` Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2017-03-30  2:53 [PATCH 0/2] Support new Alps HID I2C Touchpad device Masaki Ota
2017-03-30  2:53 ` [PATCH 1/2] Alps HID I2C T4 device support Masaki Ota
2017-04-04  3:08   ` Nikolaus Rath
2017-04-04  6:55     ` Masaki Ota
2017-04-04 17:08       ` Nikolaus Rath
2017-04-04 17:08         ` Nikolaus Rath
2017-04-04 23:40         ` Masaki Ota
2017-04-04 23:42           ` Nikolaus Rath
2017-04-04 23:42             ` Nikolaus Rath
2017-04-04 23:49             ` Masaki Ota
2017-04-05  0:01               ` Nikolaus Rath
2017-04-05  0:01                 ` Nikolaus Rath
2017-04-05  8:43                 ` Masaki Ota
2017-04-05 18:35                   ` Nikolaus Rath
2017-04-05 18:35                     ` Nikolaus Rath
2017-04-06  1:07                     ` Masaki Ota
2017-04-06 22:59                       ` Nikolaus Rath
2017-04-06 22:59                         ` Nikolaus Rath
2017-04-24 14:54   ` Benjamin Tissoires
2017-03-30  2:53 ` [PATCH 2/2] Add new U1 device ID Masaki Ota

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=64bd824c-2d09-3c8c-d35d-06d3808713b2@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=arnd@arndb.de \
    --cc=clabbe.montjoie@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.