2007-02-06 21:39:48

by Tomasz Kvarsin

[permalink] [raw]
Subject: [PATCH]: warrning fix: unsigned->signed

While compiling my code, I always get bunch of warrning from headers,
here is fix for them:
__getblk is alawys called with unsigned argument,
but it takes signed, the same story with __bread,__breadahead and so on.

Signed-off-by: Tomasz Kvarsin


Attachments:
(No filename) (246.00 B)
unsigned-fix.patch (3.11 kB)
Download all attachments

2007-02-06 22:09:43

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH]: warrning fix: unsigned->signed

On Wed, 7 Feb 2007 00:39:45 +0300
"Tomasz Kvarsin" <[email protected]> wrote:

> While compiling my code, I always get bunch of warrning from headers,
> here is fix for them:
> __getblk is alawys called with unsigned argument,
> but it takes signed, the same story with __bread,__breadahead and so on.

The patch seems OK, but I'm curious to know why you're seeing this warning
and nobody else is. Are you using a compiler other than gcc? If gcc,
which version? Did you add any new compiler options?

Thanks.

2007-02-06 22:56:25

by Oleg Verych

[permalink] [raw]
Subject: Re: [PATCH]: warrning fix: unsigned->signed

> From: Andrew Morton
> Newsgroups: gmane.linux.kernel
> Subject: Re: [PATCH]: warrning fix: unsigned->signed
> Date: Tue, 6 Feb 2007 14:09:36 -0800
Mail-Followup-To: LKML <[email protected]>, Oleg Verych <[email protected]>, Andrew Morton <[email protected]>, "Tomasz Kvarsin" <[email protected]>, [email protected], [email protected]

> On Wed, 7 Feb 2007 00:39:45 +0300
> "Tomasz Kvarsin" <[email protected]> wrote:
>
>> While compiling my code, I always get bunch of warrning from headers,
>> here is fix for them:
>> __getblk is alawys called with unsigned argument,
>> but it takes signed, the same story with __bread,__breadahead and so on.
>
> The patch seems OK, but I'm curious to know why you're seeing this warning
> and nobody else is. Are you using a compiler other than gcc? If gcc,
> which version? Did you add any new compiler options?

Andrew, i think it's due to

,-*- quote -*-
| Friends don't let friends use "-W". [0]
`-*-

I get many of them, when compiling external modules with `-Wall', of
course ;)

[0] Message-Id: [email protected]
Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/470736>

____

2007-02-07 05:31:23

by Tomasz Kvarsin

[permalink] [raw]
Subject: Re: [PATCH]: warrning fix: unsigned->signed

I uses gcc "trunk" with -Wconversion,
because of they finaly implement warrning for such things:
uint16_t a;
uint8_t b;
b = a;
see
http://gcc.gnu.org/wiki/NewWconversion

On 2/7/07, Andrew Morton <[email protected]> wrote:
> On Wed, 7 Feb 2007 00:39:45 +0300
> "Tomasz Kvarsin" <[email protected]> wrote:
>
> > While compiling my code, I always get bunch of warrning from headers,
> > here is fix for them:
> > __getblk is alawys called with unsigned argument,
> > but it takes signed, the same story with __bread,__breadahead and so on.
>
> The patch seems OK, but I'm curious to know why you're seeing this warning
> and nobody else is. Are you using a compiler other than gcc? If gcc,
> which version? Did you add any new compiler options?
>
> Thanks.
>

2007-02-07 11:53:54

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH]: warrning fix: unsigned->signed

On Tue, Feb 06 2007, Andrew Morton wrote:
> On Wed, 7 Feb 2007 00:39:45 +0300
> "Tomasz Kvarsin" <[email protected]> wrote:
>
> > While compiling my code, I always get bunch of warrning from headers,
> > here is fix for them:
> > __getblk is alawys called with unsigned argument,
> > but it takes signed, the same story with __bread,__breadahead and so on.
>
> The patch seems OK, but I'm curious to know why you're seeing this warning
> and nobody else is. Are you using a compiler other than gcc? If gcc,
> which version? Did you add any new compiler options?

While I'm not a big fan of fixing signed vs unsigned -W generated
warnings (they tend to cause more harm than good), this patch looks ok
to me as well.

--
Jens Axboe