[patch 17/37] SPARC: Fix sparc builds with gcc-4.2.x

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Friday, March 30, 2007 - 2:04 pm

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Mikael Pettersson <mikpe@it.uu.se>

[SPARC]: sparc64 gcc-4.2.0 20070317 -Werror failure

Compiling 2.6.21-rc5 with gcc-4.2.0 20070317 (prerelease)
for sparc64 fails as follows:

  gcc -Wp,-MD,arch/sparc64/kernel/.time.o.d  -nostdinc -isystem /home/mikpe/pkgs/linux-sparc64/gcc-4.2.0/lib/gcc/sparc64-unknown-linux-gnu/4.2.0/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -Werror   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)" -c -o arch/sparc64/kernel/time.o arch/sparc64/kernel/time.c
cc1: warnings being treated as errors
arch/sparc64/kernel/time.c: In function 'kick_start_clock':
arch/sparc64/kernel/time.c:559: warning: overflow in implicit constant conversion
make[1]: *** [arch/sparc64/kernel/time.o] Error 1
make: *** [arch/sparc64/kernel] Error 2

gcc gets unhappy when the MSTK_SET macro's u8 __val variable
is updated with &= ~0xff (MSTK_YEAR_MASK). Making the constant
unsigned fixes the problem.

[ I fixed up the sparc32 side as well -DaveM ]

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/asm-sparc/mostek.h   |    2 +-
 include/asm-sparc64/mostek.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/include/asm-sparc/mostek.h
+++ b/include/asm-sparc/mostek.h
@@ -87,7 +87,7 @@ extern void __iomem *mstk48t02_regs;
 #define	MSTK_DOW_MASK	0x07
 #define	MSTK_DOM_MASK	0x3f
 #define	MSTK_MONTH_MASK	0x1f
-#define	MSTK_YEAR_MASK	0xff
+#define	MSTK_YEAR_MASK	0xffU
 
 /* Binary coded decimal conversion macros. */
 #define MSTK_REGVAL_TO_DECIMAL(x)  (((x) & 0x0F) + 0x0A * ((x) >> 0x04))
--- a/include/asm-sparc64/mostek.h
+++ b/include/asm-sparc64/mostek.h
@@ -89,7 +89,7 @@ extern void __iomem *mstk48t02_regs;
 #define	MSTK_DOW_MASK	0x07
 #define	MSTK_DOM_MASK	0x3f
 #define	MSTK_MONTH_MASK	0x1f
-#define	MSTK_YEAR_MASK	0xff
+#define	MSTK_YEAR_MASK	0xffU
 
 /* Binary coded decimal conversion macros. */
 #define MSTK_REGVAL_TO_DECIMAL(x)  (((x) & 0x0F) + 0x0A * ((x) >> 0x04))

-- 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/37] 2.6.20-stable review, Greg KH, (Fri Mar 30, 2:03 pm)
[patch 04/37] UML - fix epoll, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 05/37] UML - host VDSO fix, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 06/37] UML - Fix static linking, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 06/37] UML - Fix static linking, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 08/37] uml: fix unreasonably long udelay, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 13/37] PPP: Fix PPP skb leak, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 17/37] SPARC: Fix sparc builds with gcc-4.2.x, Greg KH, (Fri Mar 30, 2:04 pm)
[patch 18/37] Fix decnet endianness, Greg KH, (Fri Mar 30, 2:05 pm)
[patch 19/37] NET: Fix FIB rules compatability, Greg KH, (Fri Mar 30, 2:05 pm)
[patch 22/37] V4L: Fix SECAM handling on saa7115, Greg KH, (Fri Mar 30, 2:05 pm)
[patch 28/37] i2o: block IO errors on i2o disk, Greg KH, (Fri Mar 30, 2:06 pm)
[patch 34/37] libata bugfix: HDIO_DRIVE_TASK, Greg KH, (Fri Mar 30, 2:06 pm)
[patch 36/37] libata: sata_mv: Fix 50xx irq mask, Greg KH, (Fri Mar 30, 2:07 pm)
Re: [patch 00/37] 2.6.20-stable review, Greg KH, (Fri Mar 30, 2:10 pm)
Re: [patch 34/37] libata bugfix: HDIO_DRIVE_TASK, Mark Lord, (Fri Mar 30, 2:42 pm)
libata bugfix: preserve LBA bit for HDIO_DRIVE_TASK, Mark Lord, (Fri Mar 30, 2:45 pm)
Re: [uml-devel] [patch 06/37] UML - Fix static linking, Blaisorblade, (Fri Mar 30, 6:21 pm)
Re: [patch 00/37] 2.6.20-stable review, Chuck Ebbert, (Wed Apr 4, 7:28 am)