Warning in block code

2 messages, 2 authors, 2009-06-17 · open the first message on its own page

Warning in block code

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2009-06-17 01:39:54

Hoy !

I see that:

block/blk-settings.c: In function ‘blk_set_default_limits’:
block/blk-settings.c:115: warning: large integer implicitly truncated to unsigned type

Comes from

	lim->bounce_pfn = BLK_BOUNCE_ANY;

With BLK_BOUNCE_ANY being a

include/linux/blkdev.h:#define BLK_BOUNCE_ANY		(-1ULL)

And struct queue_limit.bounce_pfn is:
 
	unsigned long		bounce_pfn;

(The warning is fishy as both quantities are unsigned, but there -is- truncation
happening here).

Cheers,
Ben.

Re: Warning in block code

From: Jens Axboe <hidden>
Date: 2009-06-17 04:36:16

On Wed, Jun 17 2009, Benjamin Herrenschmidt wrote:
Hoy !

I see that:

block/blk-settings.c: In function ???blk_set_default_limits???:
block/blk-settings.c:115: warning: large integer implicitly truncated to unsigned type

Comes from

	lim->bounce_pfn = BLK_BOUNCE_ANY;

With BLK_BOUNCE_ANY being a

include/linux/blkdev.h:#define BLK_BOUNCE_ANY		(-1ULL)

And struct queue_limit.bounce_pfn is:

	unsigned long		bounce_pfn;

(The warning is fishy as both quantities are unsigned, but there -is-
truncation happening here).
Should be safe to just make it -1UL now.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help