Re: [PATCH RESEND]Remove a warning for drivers/edac/i82975x_edac.c

From: Harry Wei
Date: Fri Jun 10 2011 - 01:08:52 EST


On Wed, Jun 08, 2011 at 11:17:21PM -0700, Connor Hansen wrote:
>
> this is not what the code you are changing does.
>
> the code is not assigned that value, its or'd with it.
>
> a test would be more like.
>
> #include <stdio.h>
> int main()
> {
> unsigned long page; //page
> unsigned int b = 5; //info->eap is u32 = unsigned int
> // typedef unsigned int __u32;
> page = (unsigned long) b;
> page |= 0x10000000ul;
>
> printf("%lu\n",page);
>
> return 0;
> }
>
> This produces no warning.
> $ gcc -g test.c && ./a.out
> 268435461
> $
>
> 0x10000000
> 10000000000000000000000000000
> 5
> 00000000000000000000000000101
> 0x10000000 | 5 =
> 10000000000000000000000000101
> 268435461
>
> I am green to kernel development so I will wait for someone with a bit
> more knowledge to
> chime in, or verify this warning.
> Connor

You are right, but it really has warnings yet.
My PC is also 32-bits.

Thanks
Harry Wei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/