Skip to contentSkip to conversation

cpufreq: remove unnecessary unlikely()

PATCH Applied Igor Stoppa 2 participants 2 messages Sep 7, 2018 – Sep 14, 2018 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: remove unnecessary unlikely()

WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another.

---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq.c +1 -1
index f53fb41efb7b..7aa3dcad2175 100644
@@ -403,7 +403,7 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_transition_begin);
 void cpufreq_freq_transition_end(struct cpufreq_policy *policy,
 		struct cpufreq_freqs *freqs, int transition_failed)
 {
-	if (unlikely(WARN_ON(!policy->transition_ongoing)))
+	if (WARN_ON(!policy->transition_ongoing))
 		return;
 
 	cpufreq_notify_post_transition(policy, freqs, transition_failed);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 18 lines · CEST Igor Stoppa

WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another.

---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq.c +0 -0
index f53fb41efb7b..7aa3dcad2175 100644

drivers/cpufreq/cpufreq.c EXPORT_SYMBOL_GPL(cpufreq_freq_transition_begin); · line 409

Quoted 8 lines
drivers/cpufreq/cpufreq.c +1 -1
@@ -403,7 +403,7 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_transition_begin);
 void cpufreq_freq_transition_end(struct cpufreq_policy *policy,
 		struct cpufreq_freqs *freqs, int transition_failed)
 {
-	if (unlikely(WARN_ON(!policy->transition_ongoing)))
+	if (WARN_ON(!policy->transition_ongoing))
 		return;
 
 	cpufreq_notify_post_transition(policy, freqs, transition_failed);

Applied, thanks!