]> git.karo-electronics.de Git - karo-tx-linux.git/commit
clocksource: arch_timer: Make register accessors less error-prone
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 18 Jul 2013 23:59:28 +0000 (16:59 -0700)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 31 Jul 2013 23:13:35 +0000 (01:13 +0200)
commite09f3cc0184d6b5c3816f921b7ffb67623e5e834
tree194637fbee0944aa496e5197a48cbd935c191833
parent766acb88a773dcbc98f2ae8d7ef8c147e2dccd99
clocksource: arch_timer: Make register accessors less error-prone

Using an enum for the register we wish to access allows newer
compilers to determine if we've forgotten a case in our switch
statement. This allows us to remove the BUILD_BUG() instances in
the arm64 port, avoiding problems where optimizations may not
happen.

To try and force better code generation we're currently marking
the accessor functions as inline, but newer compilers can ignore
the inline keyword unless it's marked __always_inline. Luckily on
arm and arm64 inline is __always_inline, but let's make
everything __always_inline to be explicit.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <Marc.Zyngier@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
arch/arm/include/asm/arch_timer.h
arch/arm64/include/asm/arch_timer.h
drivers/clocksource/arm_arch_timer.c
include/clocksource/arm_arch_timer.h