diff mbox

powerpc: Fix integer constant warning

Message ID 20100607203957.23695.97675.sendpatchset@squad5-lp1.lab.bos.redhat.com (mailing list archive)
State Superseded
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Steve Best June 7, 2010, 8:49 p.m. UTC
Fix ppc arch/powerpc/boot/addRamDisk.c:277: warning: integer constant
is too large for 'long' type

Signed-off-by: Steve Best <sfbest@us.ibm.com>

Comments

David Howells June 8, 2010, 1:12 p.m. UTC | #1
Steve Best <sfbest@us.ibm.com> wrote:

> -#define KERNELBASE (0xc000000000000000)
> +#define KERNELBASE (0xc000000000000000ULL)

Is this the right fix?  The code producing the warning is subtracting
0xc000000000000000 from a 32-bit number:

	naca = ntohl(*((u_int32_t*) &inbuf[0x0C])) - KERNELBASE;

which seems distinctly odd.

David
Josh Boyer June 8, 2010, 1:55 p.m. UTC | #2
On Tue, Jun 08, 2010 at 02:12:26PM +0100, David Howells wrote:
>Steve Best <sfbest@us.ibm.com> wrote:
>
>> -#define KERNELBASE (0xc000000000000000)
>> +#define KERNELBASE (0xc000000000000000ULL)
>
>Is this the right fix?  The code producing the warning is subtracting
>0xc000000000000000 from a 32-bit number:

It might not matter, since Paul sent a patch to remove this file entirely.

josh
David Howells June 8, 2010, 2:23 p.m. UTC | #3
Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:

> It might not matter, since Paul sent a patch to remove this file entirely.

Yeah, I saw that after...

David
Steve Best June 9, 2010, 11:50 a.m. UTC | #4
On Tue, 2010-06-08 at 14:12 +0100, David Howells wrote:
> Steve Best <sfbest@us.ibm.com> wrote:
> 
> > -#define KERNELBASE (0xc000000000000000)
> > +#define KERNELBASE (0xc000000000000000ULL)
> 
> Is this the right fix?  The code producing the warning is subtracting
> 0xc000000000000000 from a 32-bit number:

agree this fix needs more work, and can be dropped. Paul has another
patch that removes this file, since it is no longer used. I assume we'll
go with that patch.
> 
> 	naca = ntohl(*((u_int32_t*) &inbuf[0x0C])) - KERNELBASE;
> 
> which seems distinctly odd.
> 
> David

-Steve
diff mbox

Patch

diff -purN linux.2.6.orig/arch/powerpc/boot/addRamDisk.c linux.2.6/arch/powerpc/boot/addRamDisk.c
--- linux.2.6.orig/arch/powerpc/boot/addRamDisk.c	2010-06-07 15:20:41.763844095 -0400
+++ linux.2.6/arch/powerpc/boot/addRamDisk.c	2010-06-07 15:27:15.165100339 -0400
@@ -9,7 +9,7 @@ 
 
 #define ElfHeaderSize  (64 * 1024)
 #define ElfPages  (ElfHeaderSize / 4096)
-#define KERNELBASE (0xc000000000000000)
+#define KERNELBASE (0xc000000000000000ULL)
 #define _ALIGN_UP(addr,size)	(((addr)+((size)-1))&(~((size)-1)))
 
 struct addr_range {