From: Zhen Lei <thunder.leizhen@huawei.com>
To: Clemens Ladisch <clemens@ladisch.de>,
Arnd Bergmann <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>,
Nils Carlson <nils.carlson@ericsson.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 1/1] char: hpet: Remove unused local variable 'm' in hpet_interrupt()
Date: Thu, 15 Apr 2021 22:24:04 +0800 [thread overview]
Message-ID: <20210415142404.3846-1-thunder.leizhen@huawei.com> (raw)
Commit 273ef9509b79 ("drivers/char/hpet.c: fix periodic-emulation for
delayed interrupt") removed the reference to local variable 'm', but
forgot to remove the definition and assignment of it. Due to
read_counter() indirectly calls "read barrier", the performance is
slightly degraded.
Since the following comments give some description based on 'm', so move
the assignment of 'm' into it.
Fixes: 273ef9509b79 ("drivers/char/hpet.c: fix periodic-emulation for delayed interrupt")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/char/hpet.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index ed3b7dab678dbd1..46950a0cda181a1 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -156,14 +156,16 @@ static irqreturn_t hpet_interrupt(int irq, void *data)
* This has the effect of treating non-periodic like periodic.
*/
if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) {
- unsigned long m, t, mc, base, k;
+ unsigned long t, mc, base, k;
struct hpet __iomem *hpet = devp->hd_hpet;
struct hpets *hpetp = devp->hd_hpets;
t = devp->hd_ireqfreq;
- m = read_counter(&devp->hd_timer->hpet_compare);
mc = read_counter(&hpet->hpet_mc);
- /* The time for the next interrupt would logically be t + m,
+ /*
+ * m = read_counter(&devp->hd_timer->hpet_compare);
+ *
+ * The time for the next interrupt would logically be t + m,
* however, if we are very unlucky and the interrupt is delayed
* for longer than t then we will completely miss the next
* interrupt if we set t + m and an application will hang.
--
2.26.0.106.g9fadedd
next reply other threads:[~2021-04-15 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 14:24 Zhen Lei [this message]
2021-04-15 14:53 ` Greg Kroah-Hartman
2021-04-16 2:08 ` Leizhen (ThunderTown)
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=20210415142404.3846-1-thunder.leizhen@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=clemens@ladisch.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nils.carlson@ericsson.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
all inboxes | Powered by JetHome®