Re: [2.7.75] Misc compiler warnings

Andrew Morton (akpm@osdl.org)
Sat, 12 Jul 2003 21:50:58 -0700


Greg KH <greg@kroah.com> wrote:
>
> On Sun, Jul 13, 2003 at 02:23:29AM +0200, Christian Axelsson wrote:
> > On Sun, 2003-07-13 at 01:52, Christian Axelsson wrote:
> > > Here are some compiler warnings:
> > >
> > > CC drivers/i2c/i2c-dev.o
> > > drivers/i2c/i2c-dev.c: In function `show_dev':
> > > drivers/i2c/i2c-dev.c:121: warning: unsigned int format, different type
> > > arg (arg 3)
> > >
> > > CC drivers/usb/core/file.o
> > > drivers/usb/core/file.c: In function `show_dev':
> > > drivers/usb/core/file.c:96: warning: unsigned int format, different type
> > > arg (arg 3)
> > >
> > > AS arch/i386/boot/setup.o
> > > arch/i386/boot/setup.S: Assembler messages:
> > > arch/i386/boot/setup.S:165: Warning: value 0x37ffffff truncated to
> > > 0x37ffffff
> >
> > Ehm sorry, I should say that this is 2.5.75-mm1
> >
> > On 2.5.75-vanilla only the AS message occour.
>
> That is due to the size of dev_t being bigger in the -mm tree. When
> that moves to the main kernel tree, I'll fix up the usb and i2c
> warnings.
>

No, these need to be fixed anyway. On ppc64 (at least), dev_t is `unsigned
long'.

So on that platform the code you have in there right now will always
generate zeroes or it will oops, if there are %s's further along.

I'm not sure what's the best fix really. Maybe casting to `unsigned long
long' and handling it with %llx.

I've fixed lots of these things but have a vague feeling I've been using
`unsigned long'. That's probably good enough most of the time.

Better would be just to not play around with dev_t's in-kernel in this
manner at all. Why are we doing it?

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