Thread (8 messages) 8 messages, 4 authors, 2012-01-09

[RFC PATCH 1/9] arm: avoid using on_each_cpu hard coded ret value

From: Uwe Kleine-König <hidden>
Date: 2012-01-09 08:28:28
Also in: linux-devicetree, lkml

On Tue, Jan 03, 2012 at 04:19:05PM +0200, Gilad Ben-Yossef wrote:
quoted hunk ↗ jump to hunk
on_each_cpu always returns a hard coded return code of zero.

Removing all tests based on this return value saves run time
cycles for compares and code bloat for branches.

Cc: Michal Nazarewicz <redacted>
CC: Will Deacon <redacted>
CC: Peter Zijlstra <redacted>
CC: Paul Mackerras <redacted>
CC: Ingo Molnar <redacted>
CC: Arnaldo Carvalho de Melo <redacted>
CC: Russell King <redacted>
CC: Grant Likely <redacted>
CC: Rob Herring <redacted>
CC: linux-arm-kernel at lists.infradead.org
CC: devicetree-discuss at lists.ozlabs.org
---
 arch/arm/kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 88b0941..bfd58d8 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -617,7 +617,7 @@ static int __init
 cpu_pmu_reset(void)
 {
 	if (cpu_pmu && cpu_pmu->reset)
-		return on_each_cpu(cpu_pmu->reset, NULL, 1);
+		on_each_cpu(cpu_pmu->reset, NULL, 1);
 	return 0;
 }
 arch_initcall(cpu_pmu_reset);
This patch results in no binary change for my test build with SMP=n and
it saves one instruction on SMP=y.

Acked-by: Uwe Kleine-K?nig <redacted>

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help