linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NVMe: Fix a build error for u64 division
@ 2013-03-28 18:42 Vishal Verma
  2013-03-28 18:49 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Vishal Verma @ 2013-03-28 18:42 UTC (permalink / raw)


A u64 division was producing a linker error with CONFIG_X86_32

Signed-off-by: Vishal Verma <vishal.l.verma at intel.com>
---
 drivers/block/nvme-scsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/nvme-scsi.c b/drivers/block/nvme-scsi.c
index d5b3afe..483af35 100644
--- a/drivers/block/nvme-scsi.c
+++ b/drivers/block/nvme-scsi.c
@@ -2188,7 +2188,7 @@ static int nvme_trans_io(struct nvme_ns *ns, struct sg_io_hdr *hdr, u8 is_write,
 	xfer_bytes = min(((u64)hdr->dxfer_len), sum_iov_len);
 
 	/* If block count and actual data buffer size dont match, error out */
-	if ((xfer_bytes / (1 << ns->lba_shift)) != cdb_info.xfer_len) {
+	if (xfer_bytes != (cdb_info.xfer_len << ns->lba_shift)) {
 		res = -EINVAL;
 		goto out;
 	}
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-28 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 18:42 [PATCH] NVMe: Fix a build error for u64 division Vishal Verma
2013-03-28 18:49 ` Matthew Wilcox

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).