aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-10-18 06:07:07 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:32 -0400
commite8c44319c691dfb4a0b039b095204c040df9b01a (patch)
tree66e9262f8a2659afc9b88c570fe6980b32974177
parentc80544dc0b87bb65038355e7aafdc30be16b26ab (diff)
Replace __attribute_pure__ with __pure
To be consistent with the use of attributes in the rest of the kernel replace all use of __attribute_pure__ with __pure and delete the definition of __attribute_pure__. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Cc: Russell King <rmk@arm.linux.org.uk> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Bryan Wu <bryan.wu@analog.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arm/nwfpe/fpopcode.h6
-rw-r--r--drivers/media/video/v4l1-compat.c2
-rw-r--r--include/asm-blackfin/processor.h4
-rw-r--r--include/asm-ppc/time.h2
-rw-r--r--include/linux/compiler-gcc.h12
-rw-r--r--include/linux/compiler.h14
-rw-r--r--lib/crc32.c12
-rw-r--r--lib/libcrc32c.c6
8 files changed, 27 insertions, 31 deletions
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index ec78e3517fc9..0090b19bbe61 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -369,20 +369,20 @@ TABLE 5
369#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) 369#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
370 370
371#ifdef CONFIG_FPE_NWFPE_XP 371#ifdef CONFIG_FPE_NWFPE_XP
372static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex) 372static inline floatx80 __pure getExtendedConstant(const unsigned int nIndex)
373{ 373{
374 extern const floatx80 floatx80Constant[]; 374 extern const floatx80 floatx80Constant[];
375 return floatx80Constant[nIndex]; 375 return floatx80Constant[nIndex];
376} 376}
377#endif 377#endif
378 378
379static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex) 379static inline float64 __pure getDoubleConstant(const unsigned int nIndex)
380{ 380{
381 extern const float64 float64Constant[]; 381 extern const float64 float64Constant[];
382 return float64Constant[nIndex]; 382 return float64Constant[nIndex];
383} 383}
384 384
385static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex) 385static inline float32 __pure getSingleConstant(const unsigned int nIndex)
386{ 386{
387 extern const float32 float32Constant[]; 387 extern const float32 float32Constant[];
388 return float32Constant[nIndex]; 388 return float32Constant[nIndex];
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 9eac65f34bff..dcf22a3b672a 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -144,7 +144,7 @@ const static unsigned int palette2pixelformat[] = {
144 [VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P, 144 [VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P,
145}; 145};
146 146
147static unsigned int __attribute_pure__ 147static unsigned int __pure
148palette_to_pixelformat(unsigned int palette) 148palette_to_pixelformat(unsigned int palette)
149{ 149{
150 if (palette < ARRAY_SIZE(palette2pixelformat)) 150 if (palette < ARRAY_SIZE(palette2pixelformat))
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h
index 6bb3e0d4705d..c571e958558c 100644
--- a/include/asm-blackfin/processor.h
+++ b/include/asm-blackfin/processor.h
@@ -104,13 +104,13 @@ unsigned long get_wchan(struct task_struct *p);
104#define cpu_relax() barrier() 104#define cpu_relax() barrier()
105 105
106/* Get the Silicon Revision of the chip */ 106/* Get the Silicon Revision of the chip */
107static inline __attribute_pure__ uint32_t bfin_revid(void) 107static inline uint32_t __pure bfin_revid(void)
108{ 108{
109 /* stored in the upper 4 bits */ 109 /* stored in the upper 4 bits */
110 return bfin_read_CHIPID() >> 28; 110 return bfin_read_CHIPID() >> 28;
111} 111}
112 112
113static inline __attribute_pure__ uint32_t bfin_compiled_revid(void) 113static inline uint32_t __pure bfin_compiled_revid(void)
114{ 114{
115#if defined(CONFIG_BF_REV_0_0) 115#if defined(CONFIG_BF_REV_0_0)
116 return 0; 116 return 0;
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h
index f7eadf6ac806..81dbcd43a501 100644
--- a/include/asm-ppc/time.h
+++ b/include/asm-ppc/time.h
@@ -57,7 +57,7 @@ static __inline__ void set_dec(unsigned int val)
57/* Accessor functions for the timebase (RTC on 601) registers. */ 57/* Accessor functions for the timebase (RTC on 601) registers. */
58/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */ 58/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
59#ifdef CONFIG_6xx 59#ifdef CONFIG_6xx
60extern __inline__ int __attribute_pure__ __USE_RTC(void) { 60extern __inline__ int __pure __USE_RTC(void) {
61 return (mfspr(SPRN_PVR)>>16) == 1; 61 return (mfspr(SPRN_PVR)>>16) == 1;
62} 62}
63#else 63#else
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index acd583384bd9..fe23792f05c1 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -36,10 +36,20 @@
36#define __weak __attribute__((weak)) 36#define __weak __attribute__((weak))
37#define __naked __attribute__((naked)) 37#define __naked __attribute__((naked))
38#define __noreturn __attribute__((noreturn)) 38#define __noreturn __attribute__((noreturn))
39
40/*
41 * From the GCC manual:
42 *
43 * Many functions have no effects except the return value and their
44 * return value depends only on the parameters and/or global
45 * variables. Such a function can be subject to common subexpression
46 * elimination and loop optimization just as an arithmetic operator
47 * would be.
48 * [...]
49 */
39#define __pure __attribute__((pure)) 50#define __pure __attribute__((pure))
40#define __aligned(x) __attribute__((aligned(x))) 51#define __aligned(x) __attribute__((aligned(x)))
41#define __printf(a,b) __attribute__((format(printf,a,b))) 52#define __printf(a,b) __attribute__((format(printf,a,b)))
42#define noinline __attribute__((noinline)) 53#define noinline __attribute__((noinline))
43#define __attribute_pure__ __attribute__((pure))
44#define __attribute_const__ __attribute__((__const__)) 54#define __attribute_const__ __attribute__((__const__))
45#define __maybe_unused __attribute__((unused)) 55#define __maybe_unused __attribute__((unused))
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 86f9a3a6137d..c811c8b979ac 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -132,20 +132,6 @@ extern void __chk_io_ptr(const volatile void __iomem *);
132# define __maybe_unused /* unimplemented */ 132# define __maybe_unused /* unimplemented */
133#endif 133#endif
134 134
135/*
136 * From the GCC manual:
137 *
138 * Many functions have no effects except the return value and their
139 * return value depends only on the parameters and/or global
140 * variables. Such a function can be subject to common subexpression
141 * elimination and loop optimization just as an arithmetic operator
142 * would be.
143 * [...]
144 */
145#ifndef __attribute_pure__
146# define __attribute_pure__ /* unimplemented */
147#endif
148
149#ifndef noinline 135#ifndef noinline
150#define noinline 136#define noinline
151#endif 137#endif
diff --git a/lib/crc32.c b/lib/crc32.c
index bfc33314c720..d2c2f257bedd 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -49,7 +49,7 @@ MODULE_LICENSE("GPL");
49 * @p: pointer to buffer over which CRC is run 49 * @p: pointer to buffer over which CRC is run
50 * @len: length of buffer @p 50 * @len: length of buffer @p
51 */ 51 */
52u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len); 52u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len);
53 53
54#if CRC_LE_BITS == 1 54#if CRC_LE_BITS == 1
55/* 55/*
@@ -57,7 +57,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len);
57 * simplified by inlining the table in ?: form. 57 * simplified by inlining the table in ?: form.
58 */ 58 */
59 59
60u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) 60u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
61{ 61{
62 int i; 62 int i;
63 while (len--) { 63 while (len--) {
@@ -69,7 +69,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
69} 69}
70#else /* Table-based approach */ 70#else /* Table-based approach */
71 71
72u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) 72u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
73{ 73{
74# if CRC_LE_BITS == 8 74# if CRC_LE_BITS == 8
75 const u32 *b =(u32 *)p; 75 const u32 *b =(u32 *)p;
@@ -145,7 +145,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
145 * @p: pointer to buffer over which CRC is run 145 * @p: pointer to buffer over which CRC is run
146 * @len: length of buffer @p 146 * @len: length of buffer @p
147 */ 147 */
148u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len); 148u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len);
149 149
150#if CRC_BE_BITS == 1 150#if CRC_BE_BITS == 1
151/* 151/*
@@ -153,7 +153,7 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len);
153 * simplified by inlining the table in ?: form. 153 * simplified by inlining the table in ?: form.
154 */ 154 */
155 155
156u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) 156u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
157{ 157{
158 int i; 158 int i;
159 while (len--) { 159 while (len--) {
@@ -167,7 +167,7 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
167} 167}
168 168
169#else /* Table-based approach */ 169#else /* Table-based approach */
170u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) 170u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
171{ 171{
172# if CRC_BE_BITS == 8 172# if CRC_BE_BITS == 8
173 const u32 *b =(u32 *)p; 173 const u32 *b =(u32 *)p;
diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c
index 60f46803af3f..802f11f0bf5b 100644
--- a/lib/libcrc32c.c
+++ b/lib/libcrc32c.c
@@ -66,7 +66,7 @@ EXPORT_SYMBOL(crc32c_le);
66 * loop below with crc32 and vary the POLY if we don't find value in terms 66 * loop below with crc32 and vary the POLY if we don't find value in terms
67 * of space and maintainability in keeping the two modules separate. 67 * of space and maintainability in keeping the two modules separate.
68 */ 68 */
69u32 __attribute_pure__ 69u32 __pure
70crc32c_le(u32 crc, unsigned char const *p, size_t len) 70crc32c_le(u32 crc, unsigned char const *p, size_t len)
71{ 71{
72 int i; 72 int i;
@@ -160,7 +160,7 @@ static const u32 crc32c_table[256] = {
160 * crc using table. 160 * crc using table.
161 */ 161 */
162 162
163u32 __attribute_pure__ 163u32 __pure
164crc32c_le(u32 seed, unsigned char const *data, size_t length) 164crc32c_le(u32 seed, unsigned char const *data, size_t length)
165{ 165{
166 u32 crc = __cpu_to_le32(seed); 166 u32 crc = __cpu_to_le32(seed);
@@ -177,7 +177,7 @@ crc32c_le(u32 seed, unsigned char const *data, size_t length)
177EXPORT_SYMBOL(crc32c_be); 177EXPORT_SYMBOL(crc32c_be);
178 178
179#if CRC_BE_BITS == 1 179#if CRC_BE_BITS == 1
180u32 __attribute_pure__ 180u32 __pure
181crc32c_be(u32 crc, unsigned char const *p, size_t len) 181crc32c_be(u32 crc, unsigned char const *p, size_t len)
182{ 182{
183 int i; 183 int i;