mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 16:50:05 +00:00
scsi: myrs: fix build failure on 32 bit
For 32 bit versions we have to be careful about divisions of 64 bit quantities so use do_div() instead of a direct division. This fixes a warning about _uldivmod being undefined in certain configurations Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
4d5b4ac1ea
commit
d592dd6400
@ -1978,7 +1978,8 @@ myrs_get_resync(struct device *dev)
|
|||||||
struct scsi_device *sdev = to_scsi_device(dev);
|
struct scsi_device *sdev = to_scsi_device(dev);
|
||||||
struct myrs_hba *cs = shost_priv(sdev->host);
|
struct myrs_hba *cs = shost_priv(sdev->host);
|
||||||
struct myrs_ldev_info *ldev_info = sdev->hostdata;
|
struct myrs_ldev_info *ldev_info = sdev->hostdata;
|
||||||
u8 percent_complete = 0, status;
|
u64 percent_complete = 0;
|
||||||
|
u8 status;
|
||||||
|
|
||||||
if (sdev->channel < cs->ctlr_info->physchan_present || !ldev_info)
|
if (sdev->channel < cs->ctlr_info->physchan_present || !ldev_info)
|
||||||
return;
|
return;
|
||||||
@ -1986,8 +1987,8 @@ myrs_get_resync(struct device *dev)
|
|||||||
unsigned short ldev_num = ldev_info->ldev_num;
|
unsigned short ldev_num = ldev_info->ldev_num;
|
||||||
|
|
||||||
status = myrs_get_ldev_info(cs, ldev_num, ldev_info);
|
status = myrs_get_ldev_info(cs, ldev_num, ldev_info);
|
||||||
percent_complete = ldev_info->rbld_lba * 100 /
|
percent_complete = ldev_info->rbld_lba * 100;
|
||||||
ldev_info->cfg_devsize;
|
do_div(percent_complete, ldev_info->cfg_devsize);
|
||||||
}
|
}
|
||||||
raid_set_resync(myrs_raid_template, dev, percent_complete);
|
raid_set_resync(myrs_raid_template, dev, percent_complete);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user