diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-11-04 10:21:05 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-19 07:39:03 -0800 |
commit | ef80d1e18b014af08741cf688e3fdda1fb71363f (patch) | |
tree | 6dc63b9742606bd600dffed96c78af5036a59a4d /drivers/scsi/sd.c | |
parent | b28d108b7f9f3b51574edbf90505c467f1066c6e (diff) | |
download | lwn-ef80d1e18b014af08741cf688e3fdda1fb71363f.tar.gz lwn-ef80d1e18b014af08741cf688e3fdda1fb71363f.zip |
[SCSI] sd: Do not call do_div() with a 64-bit divisor
do_div() is meant for divisions of 64-bit number by 32-bit numbers.
Passing 64-bit divisor types caused issues in the past on 32-bit platforms,
cfr. commit ea077b1b96e073eac5c3c5590529e964767fc5f7 ("m68k: Truncate base
in do_div()").
As scsi_device.sector_size is unsigned (int), factor should be unsigned
int, too.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 35a785609364..9846c6ab2aaa 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1626,7 +1626,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd) end_lba <<= 1; } else { /* be careful ... don't want any overflows */ - u64 factor = scmd->device->sector_size / 512; + unsigned int factor = scmd->device->sector_size / 512; do_div(start_lba, factor); do_div(end_lba, factor); } |