Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=198a6d5a6189501e2b8abf4e3149ccb337866f65
Commit:     198a6d5a6189501e2b8abf4e3149ccb337866f65
Parent:     fd0b45dfd1858c6b49d06355a460bcf36d654c06
Author:     Russell King <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 12:33:54 2008 +0000
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu Jan 10 12:33:54 2008 +0000

    [ARM] pxa: silence warnings from cpu_is_xxx() macros
    
    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 <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-pxa/hardware.h |   24 ++++++++----------------
 include/asm-arm/system.h            |   13 +++++++++++++
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/include/asm-arm/arch-pxa/hardware.h 
b/include/asm-arm/arch-pxa/hardware.h
index ab2d963..e25558f 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -121,38 +121,32 @@
 
 #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());       \
         })
 
 /*
@@ -174,14 +168,12 @@
 
 #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());       \
         })
 
 /*
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 94ea8c6..28425c4 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -75,8 +75,21 @@
 #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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to