Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
198a6d5a fd0b45df

+21 -16
+8 -16
include/asm-arm/arch-pxa/hardware.h
··· 121 121 122 122 #define cpu_is_pxa21x() \ 123 123 ({ \ 124 - unsigned int id = read_cpuid(CPUID_ID); \ 125 - __cpu_is_pxa21x(id); \ 124 + __cpu_is_pxa21x(read_cpuid_id()); \ 126 125 }) 127 126 128 127 #define cpu_is_pxa25x() \ 129 128 ({ \ 130 - unsigned int id = read_cpuid(CPUID_ID); \ 131 - __cpu_is_pxa25x(id); \ 129 + __cpu_is_pxa25x(read_cpuid_id()); \ 132 130 }) 133 131 134 132 #define cpu_is_pxa27x() \ 135 133 ({ \ 136 - unsigned int id = read_cpuid(CPUID_ID); \ 137 - __cpu_is_pxa27x(id); \ 134 + __cpu_is_pxa27x(read_cpuid_id()); \ 138 135 }) 139 136 140 137 #define cpu_is_pxa300() \ 141 138 ({ \ 142 - unsigned int id = read_cpuid(CPUID_ID); \ 143 - __cpu_is_pxa300(id); \ 139 + __cpu_is_pxa300(read_cpuid_id()); \ 144 140 }) 145 141 146 142 #define cpu_is_pxa310() \ 147 143 ({ \ 148 - unsigned int id = read_cpuid(CPUID_ID); \ 149 - __cpu_is_pxa310(id); \ 144 + __cpu_is_pxa310(read_cpuid_id()); \ 150 145 }) 151 146 152 147 #define cpu_is_pxa320() \ 153 148 ({ \ 154 - unsigned int id = read_cpuid(CPUID_ID); \ 155 - __cpu_is_pxa320(id); \ 149 + __cpu_is_pxa320(read_cpuid_id()); \ 156 150 }) 157 151 158 152 /* ··· 168 174 169 175 #define cpu_is_pxa2xx() \ 170 176 ({ \ 171 - unsigned int id = read_cpuid(CPUID_ID); \ 172 - __cpu_is_pxa2xx(id); \ 177 + __cpu_is_pxa2xx(read_cpuid_id()); \ 173 178 }) 174 179 175 180 #define cpu_is_pxa3xx() \ 176 181 ({ \ 177 - unsigned int id = read_cpuid(CPUID_ID); \ 178 - __cpu_is_pxa3xx(id); \ 182 + __cpu_is_pxa3xx(read_cpuid_id()); \ 179 183 }) 180 184 181 185 /*
+13
include/asm-arm/system.h
··· 75 75 #ifndef __ASSEMBLY__ 76 76 77 77 #include <linux/linkage.h> 78 + #include <linux/stringify.h> 78 79 #include <linux/irqflags.h> 80 + 81 + /* 82 + * The CPU ID never changes at run time, so we might as well tell the 83 + * compiler that it's constant. Use this function to read the CPU ID 84 + * rather than directly reading processor_id or read_cpuid() directly. 85 + */ 86 + static inline unsigned int read_cpuid_id(void) __attribute_const__; 87 + 88 + static inline unsigned int read_cpuid_id(void) 89 + { 90 + return read_cpuid(CPUID_ID); 91 + } 79 92 80 93 #define __exception __attribute__((section(".exception.text"))) 81 94