Commit f78f694c authored by Sreekanth Reddy's avatar Sreekanth Reddy Committed by Christoph Hellwig

mpt2sas: fix undefined reference to `__udivdi3' compilation errors

This patch will fix the below compilation errors on i386 ARCH

drivers/built-in.o: In function `_scsih_qcmd':
mpt2sas_scsih.c:(.text+0x1e7b56): undefined reference to `__udivdi3'
mpt2sas_scsih.c:(.text+0x1e7b8a): undefined reference to `__umoddi3'

Used sector_div() API to fix above compilation errors.
Signed-off-by: default avatarSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 3b8155d5
...@@ -3860,7 +3860,7 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, ...@@ -3860,7 +3860,7 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
struct _raid_device *raid_device, Mpi2SCSIIORequest_t *mpi_request, struct _raid_device *raid_device, Mpi2SCSIIORequest_t *mpi_request,
u16 smid) u16 smid)
{ {
sector_t v_lba, p_lba, stripe_off, stripe_unit, column, io_size; sector_t v_lba, p_lba, stripe_off, column, io_size;
u32 stripe_sz, stripe_exp; u32 stripe_sz, stripe_exp;
u8 num_pds, cmd = scmd->cmnd[0]; u8 num_pds, cmd = scmd->cmnd[0];
...@@ -3888,9 +3888,9 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, ...@@ -3888,9 +3888,9 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
num_pds = raid_device->num_pds; num_pds = raid_device->num_pds;
p_lba = v_lba >> stripe_exp; p_lba = v_lba >> stripe_exp;
stripe_unit = p_lba / num_pds; column = sector_div(p_lba, num_pds);
column = p_lba % num_pds; p_lba = (p_lba << stripe_exp) + stripe_off;
p_lba = (stripe_unit << stripe_exp) + stripe_off;
mpi_request->DevHandle = cpu_to_le16(raid_device->pd_handle[column]); mpi_request->DevHandle = cpu_to_le16(raid_device->pd_handle[column]);
if (cmd == READ_10 || cmd == WRITE_10) if (cmd == READ_10 || cmd == WRITE_10)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment