Re: [PATCH] Replace __attribute_pure__ with __pure

Previous thread: e1000e oops by maximilian attems on Friday, October 5, 2007 - 9:11 am. (4 messages)

Next thread: Re: [patch 4/6] Fix SMP poweroff hangs by Mark Lord on Friday, October 5, 2007 - 9:39 am. (1 message)
To: Andrew Morton <akpm@...>, Russell King <rmk@...>, Mauro Carvalho Chehab <mchehab@...>, <aubrey.li@...>, <bernd.schmidt@...>, <bryan.wu@...>, <grace.pan@...>, <marc.hoffman@...>, <michael.hennerich@...>, <michael.frysinger@...>, <jerry.zeng@...>, <jie.zhang@...>, <robin.getz@...>, <roy.huang@...>, <sonic.zhang@...>, <vivi.li@...>, <yi.li@...>, <paulus@...>
Cc: <linux-kernel@...>
Date: Friday, October 5, 2007 - 9:13 am

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>

---
Patch against v2.6.23-rc8-mm2.

And btw why does Analog list half their employees in the MAINTAINERS entry?
Seems a little over the top ...

Ralf

diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index ec78e35..0090b19 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -369,20 +369,20 @@ TABLE 5
#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)

#ifdef CONFIG_FPE_NWFPE_XP
-static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex)
+static inline floatx80 __pure getExtendedConstant(const unsigned int nIndex)
{
extern const floatx80 floatx80Constant[];
return floatx80Constant[nIndex];
}
#endif

-static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex)
+static inline float64 __pure getDoubleConstant(const unsigned int nIndex)
{
extern const float64 float64Constant[];
return float64Constant[nIndex];
}

-static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex)
+static inline float32 __pure getSingleConstant(const unsigned int nIndex)
{
extern const float32 float32Constant[];
return float32Constant[nIndex];
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 9eac65f..dcf22a3 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -144,7 +144,7 @@ const static unsigned int palette2pixelformat[] = {
[VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P,
};

-static unsigned int __attribute_pure__
+static unsigned int __pure
palette_to_pixelformat(unsigned int palette)
{
if (palette < ARRAY_SIZE(palette2pixelformat))
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/pr...

To: Ralf Baechle <ralf@...>
Cc: Andrew Morton <akpm@...>, Russell King <rmk@...>, Mauro Carvalho Chehab <mchehab@...>, <aubrey.li@...>, <bernd.schmidt@...>, <bryan.wu@...>, <grace.pan@...>, <marc.hoffman@...>, <michael.hennerich@...>, <michael.frysinger@...>, <jerry.zeng@...>, <jie.zhang@...>, <robin.getz@...>, <roy.huang@...>, <sonic.zhang@...>, <vivi.li@...>, <yi.li@...>, <paulus@...>, <linux-kernel@...>
Date: Friday, October 5, 2007 - 8:51 pm

Concern: __attribute_pure__ is very similar to __attribute_const__,
which is almost completely, but not totally unlike the keyword "const"...

-hpa
-

To: H. Peter Anvin <hpa@...>
Cc: Ralf Baechle <ralf@...>, Andrew Morton <akpm@...>, Russell King <rmk@...>, Mauro Carvalho Chehab <mchehab@...>, <bryan.wu@...>, <michael.frysinger@...>, <robin.getz@...>, Paul Mackerras <paulus@...>, LKML Kernel <linux-kernel@...>
Date: Saturday, October 6, 2007 - 2:49 pm

Trimmed the CC list a bit

Yes, there's also the fact that __pure is a reserved GCC keyword.
Essentially according to GCC docs all of the GCC-specific keywords
are equivalently defined as "keyword", "__keyword", and
"__keyword__", with only the latter two defined in strict-ANSI mode.
The following is valid according to GCC docs:

static int __attribute__((__pure)) my_strlen(const char *str);

With the proposed definition of __pure, that becomes a noticeably
invalid __attribute__((__attribute__((__pure__))))

Cheers,
Kyle Moffett

-

To: Andrew Morton <akpm@...>, Ralf Baechle <ralf@...>
Cc: <linux-kernel@...>, Bryan Wu <bryan.wu@...>
Date: Friday, October 5, 2007 - 6:36 pm

Yeah, the original submission got a little carried away...

We can cut that down to just Bryan and the mailing list I think.

-Robin
-

To: Ralf Baechle <ralf@...>
Cc: Andrew Morton <akpm@...>, Russell King <rmk@...>, Mauro Carvalho Chehab <mchehab@...>, <aubrey.li@...>, <bernd.schmidt@...>, <bryan.wu@...>, <grace.pan@...>, <marc.hoffman@...>, <michael.hennerich@...>, <michael.frysinger@...>, <jerry.zeng@...>, <jie.zhang@...>, <robin.getz@...>, <roy.huang@...>, <sonic.zhang@...>, <vivi.li@...>, <yi.li@...>, <paulus@...>, <linux-kernel@...>
Date: Friday, October 5, 2007 - 11:35 am

doesnt matter one way or the other to me, so:

this is supposed to be replaced with just the mailing list
-mike
-

To: Ralf Baechle <ralf@...>
Cc: Andrew Morton <akpm@...>, Russell King <rmk@...>, <aubrey.li@...>, <bernd.schmidt@...>, <bryan.wu@...>, <grace.pan@...>, <marc.hoffman@...>, <michael.hennerich@...>, <michael.frysinger@...>, <jerry.zeng@...>, <jie.zhang@...>, <robin.getz@...>, <roy.huang@...>, <sonic.zhang@...>, <vivi.li@...>, <yi.li@...>, <paulus@...>, <linux-kernel@...>
Date: Friday, October 5, 2007 - 9:23 am

Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>

Cheers,
Mauro

-

Previous thread: e1000e oops by maximilian attems on Friday, October 5, 2007 - 9:11 am. (4 messages)

Next thread: Re: [patch 4/6] Fix SMP poweroff hangs by Mark Lord on Friday, October 5, 2007 - 9:39 am. (1 message)