* [PATCH][SCSI] mpt2sas: fix undefined reference to `__udivdi3' compilation errors
@ 2014-09-19 6:47 Sreekanth Reddy
2014-09-22 11:16 ` Christoph Hellwig
2014-09-22 13:42 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Sreekanth Reddy @ 2014-09-19 6:47 UTC (permalink / raw)
To: jejb, hch
Cc: martin.petersen, linux-scsi, JBottomley, Sathya.Prakash,
Nagalakshmi.Nandigama, linux-kernel, fengguang.wu,
Sreekanth Reddy
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: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
---
drivers/scsi/mpt2sas/mpt2sas_scsih.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 992a224..c80ed04 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -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,
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;
u8 num_pds, cmd = scmd->cmnd[0];
@@ -3888,9 +3888,9 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
num_pds = raid_device->num_pds;
p_lba = v_lba >> stripe_exp;
- stripe_unit = p_lba / num_pds;
- column = p_lba % num_pds;
- p_lba = (stripe_unit << stripe_exp) + stripe_off;
+ column = sector_div(p_lba, num_pds);
+ p_lba = (p_lba << stripe_exp) + stripe_off;
+
mpi_request->DevHandle = cpu_to_le16(raid_device->pd_handle[column]);
if (cmd == READ_10 || cmd == WRITE_10)
--
2.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][SCSI] mpt2sas: fix undefined reference to `__udivdi3' compilation errors
2014-09-19 6:47 [PATCH][SCSI] mpt2sas: fix undefined reference to `__udivdi3' compilation errors Sreekanth Reddy
@ 2014-09-22 11:16 ` Christoph Hellwig
2014-09-22 13:42 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-09-22 11:16 UTC (permalink / raw)
To: Sreekanth Reddy
Cc: jejb, hch, martin.petersen, linux-scsi, JBottomley,
Sathya.Prakash, Nagalakshmi.Nandigama, linux-kernel,
fengguang.wu
Looks good to me. Can I get a quick second review?
On Fri, Sep 19, 2014 at 12:17:27PM +0530, Sreekanth Reddy wrote:
> 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: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
> ---
> drivers/scsi/mpt2sas/mpt2sas_scsih.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
> index 992a224..c80ed04 100644
> --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
> +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
> @@ -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,
> 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;
> u8 num_pds, cmd = scmd->cmnd[0];
>
> @@ -3888,9 +3888,9 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
>
> num_pds = raid_device->num_pds;
> p_lba = v_lba >> stripe_exp;
> - stripe_unit = p_lba / num_pds;
> - column = p_lba % num_pds;
> - p_lba = (stripe_unit << stripe_exp) + stripe_off;
> + column = sector_div(p_lba, num_pds);
> + p_lba = (p_lba << stripe_exp) + stripe_off;
> +
> mpi_request->DevHandle = cpu_to_le16(raid_device->pd_handle[column]);
>
> if (cmd == READ_10 || cmd == WRITE_10)
> --
> 2.0.2
>
---end quoted text---
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][SCSI] mpt2sas: fix undefined reference to `__udivdi3' compilation errors
2014-09-19 6:47 [PATCH][SCSI] mpt2sas: fix undefined reference to `__udivdi3' compilation errors Sreekanth Reddy
2014-09-22 11:16 ` Christoph Hellwig
@ 2014-09-22 13:42 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2014-09-22 13:42 UTC (permalink / raw)
To: Sreekanth Reddy
Cc: jejb, hch, martin.petersen, linux-scsi, JBottomley,
Sathya.Prakash, Nagalakshmi.Nandigama, linux-kernel,
fengguang.wu
>>>>> "Sreekanth" == Sreekanth Reddy <sreekanth.reddy@avagotech.com> writes:
Sreekanth> This patch will fix the below compilation errors on i386 ARCH
Sreekanth> drivers/built-in.o: In function `_scsih_qcmd':
Sreekanth> mpt2sas_scsih.c:(.text+0x1e7b56): undefined reference to
Sreekanth> `__udivdi3' mpt2sas_scsih.c:(.text+0x1e7b8a): undefined
Sreekanth> reference to `__umoddi3'
Sreekanth> Used sector_div() API to fix above compilation errors.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-22 13:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19 6:47 [PATCH][SCSI] mpt2sas: fix undefined reference to `__udivdi3' compilation errors Sreekanth Reddy
2014-09-22 11:16 ` Christoph Hellwig
2014-09-22 13:42 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).