]> err.no Git - linux-2.6/commitdiff
[ARM] pxa: silence warnings from cpu_is_xxx() macros
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Thu, 10 Jan 2008 12:33:54 +0000 (12:33 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 10 Jan 2008 12:33:54 +0000 (12:33 +0000)
If only a single CPU type is selected, __cpu_is_xxx() doesn't
use its argument.  This causes the compiler to issue a warning
about an unused variable in the parent function.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
include/asm-arm/arch-pxa/hardware.h
include/asm-arm/system.h

index ab2d963e742a46c26185c7358e8ad28a0438ee51..e25558faa5a480f7b2c2fa78d444244e071e9ae6 100644 (file)
 
 #define cpu_is_pxa21x()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa21x(id);                    \
+               __cpu_is_pxa21x(read_cpuid_id());       \
        })
 
 #define cpu_is_pxa25x()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa25x(id);                    \
+               __cpu_is_pxa25x(read_cpuid_id());       \
        })
 
 #define cpu_is_pxa27x()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa27x(id);                    \
+               __cpu_is_pxa27x(read_cpuid_id());       \
        })
 
 #define cpu_is_pxa300()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa300(id);                    \
+               __cpu_is_pxa300(read_cpuid_id());       \
         })
 
 #define cpu_is_pxa310()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa310(id);                    \
+               __cpu_is_pxa310(read_cpuid_id());       \
         })
 
 #define cpu_is_pxa320()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa320(id);                    \
+               __cpu_is_pxa320(read_cpuid_id());       \
         })
 
 /*
 
 #define cpu_is_pxa2xx()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa2xx(id);                    \
+               __cpu_is_pxa2xx(read_cpuid_id());       \
         })
 
 #define cpu_is_pxa3xx()                                        \
        ({                                              \
-               unsigned int id = read_cpuid(CPUID_ID); \
-               __cpu_is_pxa3xx(id);                    \
+               __cpu_is_pxa3xx(read_cpuid_id());       \
         })
 
 /*
index 94ea8c6dc1a4485014fd9bb8fbd7c29078e69696..28425c473e71c72c7a959f6650fc6707a89d6b0e 100644 (file)
 #ifndef __ASSEMBLY__
 
 #include <linux/linkage.h>
+#include <linux/stringify.h>
 #include <linux/irqflags.h>
 
+/*
+ * The CPU ID never changes at run time, so we might as well tell the
+ * compiler that it's constant.  Use this function to read the CPU ID
+ * rather than directly reading processor_id or read_cpuid() directly.
+ */
+static inline unsigned int read_cpuid_id(void) __attribute_const__;
+
+static inline unsigned int read_cpuid_id(void)
+{
+       return read_cpuid(CPUID_ID);
+}
+
 #define __exception    __attribute__((section(".exception.text")))
 
 struct thread_info;