NVMe: Fix a build error for u64 division
Subsystems (2)
PATCH 1/1 NVMe: Fix a build error for u64 division
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(-)
drivers/block/nvme-scsi.c +1 -1
@@ -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; }
Signature · 1 line
1.7.0.4
PATCH 1/1 NVMe: Fix a build error for u64 division
Quoted 1 line · Vishal Verma
A u64 division was producing a linker error with
CONFIG_X86_32
That wasn't the only problem with this line though, was it? :-)
I'll merge this patch into the current patch on the top of the tree so that we don't cause build problems for people running a git bisect.
Quoted 26 lines
Signed-off-by Vishal Verma <vishal.l.verma at intel.com>--- drivers/block/nvme-scsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/nvme-scsi.c +1
-1@@ -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; }Signature · 7 lines
1.7.0.4 _______________________________________________ Linux-nvme mailing list Linux-nvme at lists.infradead.org http://merlin.infradead.org/mailman/listinfo/linux-nvme