ARM: use get_cr() rather than cr_alignment
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 13 Apr 2014 17:47:34 +0000 (18:47 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 22 May 2014 15:27:27 +0000 (16:27 +0100)
Rather than reading the cr_alignment variable, use get_cr() to read
directly from the hardware instead.  We have two places where this
occurs, neither of them are performance critical.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/cp15.h
arch/arm/kernel/setup.c
arch/arm/mm/alignment.c

index d5bf322a06301ae40f98ff08129d9d8a4f0b4bde..63427266015d4c0a914157dd494062a46d0f2697 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __ASSEMBLY__
 
 #if __LINUX_ARM_ARCH__ >= 4
-#define vectors_high() (cr_alignment & CR_V)
+#define vectors_high() (get_cr() & CR_V)
 #else
 #define vectors_high() (0)
 #endif
@@ -113,6 +113,11 @@ static inline void set_copro_access(unsigned int val)
 #define cr_no_alignment        UL(0)
 #define cr_alignment   UL(0)
 
+static inline unsigned long get_cr(void)
+{
+       return 0;
+}
+
 #endif /* ifdef CONFIG_CPU_CP15 / else */
 
 #endif /* ifndef __ASSEMBLY__ */
index 50e198c1e9c8a16f1b4e06563682e6046f564951..df21f9f98945170f431779d3edbf8cbd949cb377 100644 (file)
@@ -590,7 +590,7 @@ static void __init setup_processor(void)
 
        pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
                cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
-               proc_arch[cpu_architecture()], cr_alignment);
+               proc_arch[cpu_architecture()], get_cr());
 
        snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
                 list->arch_name, ENDIANNESS);
index 924036473b16f437019002b8afac36a2a41e4010..1ab611ce50095f64639dcc1af91736d8918867cb 100644 (file)
@@ -91,7 +91,7 @@ core_param(alignment, ai_usermode, int, 0600);
 /* Return true if and only if the ARMv6 unaligned access model is in use. */
 static bool cpu_is_v6_unaligned(void)
 {
-       return cpu_architecture() >= CPU_ARCH_ARMv6 && (cr_alignment & CR_U);
+       return cpu_architecture() >= CPU_ARCH_ARMv6 && get_cr() & CR_U;
 }
 
 static int safe_usermode(int new_usermode, bool warn)
This page took 0.026939 seconds and 5 git commands to generate.