linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Remove __const__ due to GCC warning
@ 2003-04-22 16:09 Art Haas
  2003-04-22 19:14 ` H. Peter Anvin
  0 siblings, 1 reply; 2+ messages in thread
From: Art Haas @ 2003-04-22 16:09 UTC (permalink / raw)
  To: linux-kernel

Hi.

These two patches remove a warning GCC produces about using __const__
where it doesn't matter. I've built numerous kernels with these patches
and things seem to work fine, so I thought I'd send them out. Maybe GCC
is right, or maybe it isn't ...

BTW, the warning appears if '-W' is added to the compile commands.

Art Haas

===== include/asm-i386/byteorder.h 1.2 vs edited =====
--- 1.2/include/asm-i386/byteorder.h	Fri Oct 11 12:15:35 2002
+++ edited/include/asm-i386/byteorder.h	Tue Feb 11 09:39:35 2003
@@ -10,7 +10,7 @@
 #include <linux/config.h>
 #endif
 
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
 {
 #ifdef CONFIG_X86_BSWAP
 	__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -26,7 +26,7 @@
 
 /* gcc should generate this for open coded C now too. May be worth switching to 
    it because inline assembly cannot be scheduled. -AK */
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
 {
 	__asm__("xchgb %b0,%h0"		/* swap bytes		*/
 		: "=q" (x)
===== include/linux/byteorder/swab.h 1.2 vs edited =====
--- 1.2/include/linux/byteorder/swab.h	Tue Feb  5 01:43:00 2002
+++ edited/include/linux/byteorder/swab.h	Tue Feb 11 09:39:15 2003
@@ -128,7 +128,7 @@
 #endif /* OPTIMIZE */
 
 
-static __inline__ __const__ __u16 __fswab16(__u16 x)
+static __inline__  __u16 __fswab16(__u16 x)
 {
 	return __arch__swab16(x);
 }
@@ -141,7 +141,7 @@
 	__arch__swab16s(addr);
 }
 
-static __inline__ __const__ __u32 __fswab32(__u32 x)
+static __inline__ __u32 __fswab32(__u32 x)
 {
 	return __arch__swab32(x);
 }
@@ -155,7 +155,7 @@
 }
 
 #ifdef __BYTEORDER_HAS_U64__
-static __inline__ __const__ __u64 __fswab64(__u64 x)
+static __inline__ __u64 __fswab64(__u64 x)
 {
 #  ifdef __SWAB_64_THRU_32__
 	__u32 h = x >> 32;
-- 
To announce that there must be no criticism of the President, or that we
are to stand by the President, right or wrong, is not only unpatriotic
and servile, but is morally treasonable to the American public.
 -- Theodore Roosevelt, Kansas City Star, 1918

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Remove __const__ due to GCC warning
  2003-04-22 16:09 [PATCH] Remove __const__ due to GCC warning Art Haas
@ 2003-04-22 19:14 ` H. Peter Anvin
  0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2003-04-22 19:14 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20030422160953.GF7260@debian>
By author:    Art Haas <ahaas@airmail.net>
In newsgroup: linux.dev.kernel
>
> Hi.
> 
> These two patches remove a warning GCC produces about using __const__
> where it doesn't matter. I've built numerous kernels with these patches
> and things seem to work fine, so I thought I'd send them out. Maybe GCC
> is right, or maybe it isn't ...
> 
> BTW, the warning appears if '-W' is added to the compile commands.
> 

This seems like the wrong approach.  Instead this presumably should be
__attribute__((const)) instead.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-22 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-22 16:09 [PATCH] Remove __const__ due to GCC warning Art Haas
2003-04-22 19:14 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).