Skip to contentSkip to conversation

powerpc: remove unnecessary unlikely()

PATCH Applied Igor Stoppa 2 participants 2 messages Sep 7, 2018 – Jan 24, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: remove unnecessary unlikely()

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

Cc Arseny Solokha <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
 arch/powerpc/mm/tlb_nohash.c      | 2 +-
 arch/powerpc/sysdev/xive/common.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/mm/tlb_nohash.c +1 -1
index 15fe5f0c8665..46f5d8c972fb 100644
@@ -302,7 +302,7 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
 	 * This function as well as __local_flush_tlb_page() must only be called
 	 * for user contexts.
 	 */
-	if (unlikely(WARN_ON(!mm)))
+	if (WARN_ON(!mm))
 		return;
 
 	preempt_disable();
arch/powerpc/sysdev/xive/common.c +1 -1
index 959a2a62f233..7dde46b38979 100644
@@ -442,7 +442,7 @@ static void xive_dec_target_count(int cpu)
 	struct xive_cpu *xc = per_cpu(xive_cpu, cpu);
 	struct xive_q *q = &xc->queue[xive_irq_priority];
 
-	if (unlikely(WARN_ON(cpu < 0 || !xc))) {
+	if (WARN_ON(cpu < 0 || !xc)) {
 		pr_err("%s: cpu=%d xc=%p\n", __func__, cpu, xc);
 		return;
 	}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · Igor Stoppa

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

Cc Arseny Solokha <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/63da6caeb84cfad3d1e5774b7049dd1d

cheers