From: tip-bot for Yangtao Li <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tiny.windzz@gmail.com, linux-kernel@vger.kernel.org,
mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de
Subject: [tip:timers/core] clockevents: Remove unnecessary unlikely()
Date: Mon, 5 Nov 2018 05:27:54 -0800 [thread overview]
Message-ID: <tip-7d9df98be66fec64349f9f1c9d3e896293fe7b45@git.kernel.org> (raw)
In-Reply-To: <20181104023104.2572-1-tiny.windzz@gmail.com>
Commit-ID: 7d9df98be66fec64349f9f1c9d3e896293fe7b45
Gitweb: https://git.kernel.org/tip/7d9df98be66fec64349f9f1c9d3e896293fe7b45
Author: Yangtao Li <tiny.windzz@gmail.com>
AuthorDate: Sat, 3 Nov 2018 22:31:04 -0400
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 5 Nov 2018 14:22:54 +0100
clockevents: Remove unnecessary unlikely()
WARN_ON() and WARN_ON_ONCE() already contains an unlikely(), so it's not
necessary to use unlikely.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20181104023104.2572-1-tiny.windzz@gmail.com
---
kernel/time/clockevents.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 8c0e4092f661..af58898d9ebf 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -39,10 +39,8 @@ static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt,
u64 clc = (u64) latch << evt->shift;
u64 rnd;
- if (unlikely(!evt->mult)) {
+ if (WARN_ON(!evt->mult))
evt->mult = 1;
- WARN_ON(1);
- }
rnd = (u64) evt->mult - 1;
/*
@@ -164,10 +162,8 @@ void clockevents_switch_state(struct clock_event_device *dev,
* on it, so fix it up and emit a warning:
*/
if (clockevent_state_oneshot(dev)) {
- if (unlikely(!dev->mult)) {
+ if (WARN_ON(!dev->mult))
dev->mult = 1;
- WARN_ON(1);
- }
}
}
}
@@ -315,10 +311,8 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
int64_t delta;
int rc;
- if (unlikely(expires < 0)) {
- WARN_ON_ONCE(1);
+ if (WARN_ON_ONCE(expires < 0))
return -ETIME;
- }
dev->next_event = expires;
prev parent reply other threads:[~2018-11-05 13:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 2:31 [PATCH] clockevents: remove unnecessary unlikely() Yangtao Li
2018-11-05 13:27 ` tip-bot for Yangtao Li [this message]
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=tip-7d9df98be66fec64349f9f1c9d3e896293fe7b45@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=tiny.windzz@gmail.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;
as well as URLs for NNTP newsgroup(s).