mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* blk-settings.c integer truncation
@ 2009-06-19  9:04 Sergey Senozhatsky
  2009-06-19 14:24 ` Martin K. Petersen
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2009-06-19  9:04 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Martin K. Petersen, linux-kernel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread
* blk-settings.c integer truncation
@ 2009-06-19  9:20 Sergey Senozhatsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2009-06-19  9:20 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Martin K. Petersen, linux-kernel

Hello.
I was asking
> Should BLK_BOUNCE_ANY be (-1UL)?

No. It should not.

git annotate gives for blkdev.h:
Andi Kleen     2008-04-21 09:51:05 +0200       705)#define BLK_BOUNCE_ANY              (-1ULL)
...

...
(Martin K. Petersen     2009-05-22 17:17:51 -0400       311)    unsigned long           bounce_pfn;
...
(Martin K. Petersen     2009-05-22 17:17:50 -0400       1020)static inline unsigned long queue_bounce_pfn(struct request_queue *q)
(Martin K. Petersen     2009-05-22 17:17:50 -0400       1021){
(Martin K. Petersen     2009-05-22 17:17:51 -0400       1022)   return q->limits.bounce_pfn;
(Martin K. Petersen     2009-05-22 17:17:50 -0400       1023)}
...

I think, commit need to be reworked a bit.

	Sergey

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-19 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-19  9:04 blk-settings.c integer truncation Sergey Senozhatsky
2009-06-19 14:24 ` Martin K. Petersen
2009-06-19 14:40   ` Sergey Senozhatsky
2009-06-19  9:20 Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®