mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-18 20:54:20 +00:00
[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 ea077b1b96
("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>
This commit is contained in:
parent
b28d108b7f
commit
ef80d1e18b
1 changed files with 1 additions and 1 deletions
|
@ -1626,7 +1626,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
|
||||||
end_lba <<= 1;
|
end_lba <<= 1;
|
||||||
} else {
|
} else {
|
||||||
/* be careful ... don't want any overflows */
|
/* 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(start_lba, factor);
|
||||||
do_div(end_lba, factor);
|
do_div(end_lba, factor);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue