2003-07-12 23:38:29

by Christian Axelsson

[permalink] [raw]
Subject: [2.7.75] Misc compiler warnings

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


--
Christian Axelsson
[email protected]


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-07-13 00:08:57

by Christian Axelsson

[permalink] [raw]
Subject: Re: [2.7.75] Misc compiler warnings

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.

--
Christian Axelsson
[email protected]


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-07-13 04:14:37

by Greg KH

[permalink] [raw]
Subject: Re: [2.7.75] Misc compiler warnings

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.

thanks,

greg k-h

2003-07-13 04:36:14

by Andrew Morton

[permalink] [raw]
Subject: Re: [2.7.75] Misc compiler warnings

Greg KH <[email protected]> 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?

2003-07-13 05:14:51

by Greg KH

[permalink] [raw]
Subject: Re: [2.7.75] Misc compiler warnings

On Sat, Jul 12, 2003 at 09:50:58PM -0700, Andrew Morton wrote:
>
> 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 export to userspace the dev_t assigned to a device. I should just
make a single function for this, but haven't gotten arround to it yet.

I'll fix these up to remove the warnings.

thanks,

greg k-h