Skip to content

Commit e8c4431

Browse files
ralfbaechleLinus Torvalds
authored and
Linus Torvalds
committed
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>
1 parent c80544d commit e8c4431

File tree

8 files changed

+27
-31
lines changed

8 files changed

+27
-31
lines changed

arch/arm/nwfpe/fpopcode.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -369,20 +369,20 @@ TABLE 5
369369
#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
370370

371371
#ifdef CONFIG_FPE_NWFPE_XP
372-
static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex)
372+
static inline floatx80 __pure getExtendedConstant(const unsigned int nIndex)
373373
{
374374
extern const floatx80 floatx80Constant[];
375375
return floatx80Constant[nIndex];
376376
}
377377
#endif
378378

379-
static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex)
379+
static inline float64 __pure getDoubleConstant(const unsigned int nIndex)
380380
{
381381
extern const float64 float64Constant[];
382382
return float64Constant[nIndex];
383383
}
384384

385-
static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex)
385+
static inline float32 __pure getSingleConstant(const unsigned int nIndex)
386386
{
387387
extern const float32 float32Constant[];
388388
return float32Constant[nIndex];

drivers/media/video/v4l1-compat.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const static unsigned int palette2pixelformat[] = {
144144
[VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P,
145145
};
146146

147-
static unsigned int __attribute_pure__
147+
static unsigned int __pure
148148
palette_to_pixelformat(unsigned int palette)
149149
{
150150
if (palette < ARRAY_SIZE(palette2pixelformat))

include/asm-blackfin/processor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ unsigned long get_wchan(struct task_struct *p);
104104
#define cpu_relax() barrier()
105105

106106
/* Get the Silicon Revision of the chip */
107-
static inline __attribute_pure__ uint32_t bfin_revid(void)
107+
static inline uint32_t __pure bfin_revid(void)
108108
{
109109
/* stored in the upper 4 bits */
110110
return bfin_read_CHIPID() >> 28;
111111
}
112112

113-
static inline __attribute_pure__ uint32_t bfin_compiled_revid(void)
113+
static inline uint32_t __pure bfin_compiled_revid(void)
114114
{
115115
#if defined(CONFIG_BF_REV_0_0)
116116
return 0;

include/asm-ppc/time.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static __inline__ void set_dec(unsigned int val)
5757
/* Accessor functions for the timebase (RTC on 601) registers. */
5858
/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
5959
#ifdef CONFIG_6xx
60-
extern __inline__ int __attribute_pure__ __USE_RTC(void) {
60+
extern __inline__ int __pure __USE_RTC(void) {
6161
return (mfspr(SPRN_PVR)>>16) == 1;
6262
}
6363
#else

include/linux/compiler-gcc.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@
3636
#define __weak __attribute__((weak))
3737
#define __naked __attribute__((naked))
3838
#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+
*/
3950
#define __pure __attribute__((pure))
4051
#define __aligned(x) __attribute__((aligned(x)))
4152
#define __printf(a,b) __attribute__((format(printf,a,b)))
4253
#define noinline __attribute__((noinline))
43-
#define __attribute_pure__ __attribute__((pure))
4454
#define __attribute_const__ __attribute__((__const__))
4555
#define __maybe_unused __attribute__((unused))

include/linux/compiler.h

-14
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,6 @@ extern void __chk_io_ptr(const volatile void __iomem *);
132132
# define __maybe_unused /* unimplemented */
133133
#endif
134134

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-
149135
#ifndef noinline
150136
#define noinline
151137
#endif

lib/crc32.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ MODULE_LICENSE("GPL");
4949
* @p: pointer to buffer over which CRC is run
5050
* @len: length of buffer @p
5151
*/
52-
u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len);
52+
u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len);
5353

5454
#if CRC_LE_BITS == 1
5555
/*
5656
* In fact, the table-based code will work in this case, but it can be
5757
* simplified by inlining the table in ?: form.
5858
*/
5959

60-
u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
60+
u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
6161
{
6262
int i;
6363
while (len--) {
@@ -69,7 +69,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
6969
}
7070
#else /* Table-based approach */
7171

72-
u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
72+
u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
7373
{
7474
# if CRC_LE_BITS == 8
7575
const u32 *b =(u32 *)p;
@@ -145,15 +145,15 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
145145
* @p: pointer to buffer over which CRC is run
146146
* @len: length of buffer @p
147147
*/
148-
u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len);
148+
u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len);
149149

150150
#if CRC_BE_BITS == 1
151151
/*
152152
* In fact, the table-based code will work in this case, but it can be
153153
* simplified by inlining the table in ?: form.
154154
*/
155155

156-
u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
156+
u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
157157
{
158158
int i;
159159
while (len--) {
@@ -167,7 +167,7 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
167167
}
168168

169169
#else /* Table-based approach */
170-
u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
170+
u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
171171
{
172172
# if CRC_BE_BITS == 8
173173
const u32 *b =(u32 *)p;

lib/libcrc32c.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ EXPORT_SYMBOL(crc32c_le);
6666
* loop below with crc32 and vary the POLY if we don't find value in terms
6767
* of space and maintainability in keeping the two modules separate.
6868
*/
69-
u32 __attribute_pure__
69+
u32 __pure
7070
crc32c_le(u32 crc, unsigned char const *p, size_t len)
7171
{
7272
int i;
@@ -160,7 +160,7 @@ static const u32 crc32c_table[256] = {
160160
* crc using table.
161161
*/
162162

163-
u32 __attribute_pure__
163+
u32 __pure
164164
crc32c_le(u32 seed, unsigned char const *data, size_t length)
165165
{
166166
u32 crc = __cpu_to_le32(seed);
@@ -177,7 +177,7 @@ crc32c_le(u32 seed, unsigned char const *data, size_t length)
177177
EXPORT_SYMBOL(crc32c_be);
178178

179179
#if CRC_BE_BITS == 1
180-
u32 __attribute_pure__
180+
u32 __pure
181181
crc32c_be(u32 crc, unsigned char const *p, size_t len)
182182
{
183183
int i;

0 commit comments

Comments
 (0)