Skip to contentSkip to conversation

blk-settings.c integer truncation

DISCUSSION Sergey Senozhatsky 2 participants 3 messages Jun 19, 2009

lore
Share & tools
lore
#0 lore raw

Hello.

commit e475bba2fdee9c3dbfe25f026f8fb8de69508ad2 introduced 'void blk_set_default_limits(struct queue_limits *lim)'

blkdev.h
...
#endif
#define BLK_BOUNCE_ANY (-1ULL)
#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)

struct queue_limits {
	unsigned long		bounce_pfn;
	unsigned long		seg_boundary_mask;

....
};

Assignment at block/blk-settings.c:115 (4 bytes = 8 bytes):
lim->bounce_pfn = BLK_BOUNCE_ANY;

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

Should BLK_BOUNCE_ANY be (-1UL)?

Thanks.

Sergey

p.s.
In case it's already fixed - let me know.

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sergey" == Sergey Senozhatsky <[email protected]> writes:

Sergey> Hello. commit e475bba2fdee9c3dbfe25f026f8fb8de69508ad2 Sergey> introduced 'void blk_set_default_limits(struct queue_limits Sergey> *lim)'

This was discussed here a couple of days ago. There is a fix in Jens' tree but Linus hasn't pulled it yet.

In any case the warning is harmless.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
Quoted 14 lines · Martin K. Petersen
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sergey" == Sergey Senozhatsky <[email protected]> writes:

Sergey> Hello. commit e475bba2fdee9c3dbfe25f026f8fb8de69508ad2 Sergey> introduced 'void blk_set_default_limits(struct queue_limits Sergey> *lim)'

This was discussed here a couple of days ago. There is a fix in Jens' tree but Linus hasn't pulled it yet.

In any case the warning is harmless.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering

OK. Thanks.

Sergey