summaryrefslogtreecommitdiff
path: root/drivers/scsi/cxlflash/superpipe.c
diff options
context:
space:
mode:
authorManoj Kumar <kumarmn@us.ibm.com>2015-10-21 20:11:00 (GMT)
committerJames Bottomley <JBottomley@Odin.com>2015-10-30 07:57:55 (GMT)
commit3ebf203093b4ee07d62ef1a02dbbf7a293770388 (patch)
tree0740b929e699e3098a677755b80a199a08b1e858 /drivers/scsi/cxlflash/superpipe.c
parentfa4aa632da19fba0154b66a50329acd738304291 (diff)
downloadlinux-3ebf203093b4ee07d62ef1a02dbbf7a293770388.tar.xz
cxlflash: Replace magic numbers with literals
Magic numbers are not meaningful and can create confusion. As a remedy, replace them with descriptive literals. Replace 512 with literal MAX_SECTOR_UNIT. Replace 5 with literal CMD_RETRIES. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com> Reviewed-by: Brian King <brking@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxlflash/superpipe.c')
-rw-r--r--drivers/scsi/cxlflash/superpipe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index f1b62ce..7df985d 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -315,7 +315,8 @@ retry:
retry_cnt ? "re" : "", scsi_cmd[0]);
result = scsi_execute(sdev, scsi_cmd, DMA_FROM_DEVICE, cmd_buf,
- CMD_BUFSIZE, sense_buf, tout, 5, 0, NULL);
+ CMD_BUFSIZE, sense_buf, tout, CMD_RETRIES,
+ 0, NULL);
if (driver_byte(result) == DRIVER_SENSE) {
result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */
@@ -1375,7 +1376,8 @@ out_attach:
attach->block_size = gli->blk_len;
attach->mmio_size = sizeof(afu->afu_map->hosts[0].harea);
attach->last_lba = gli->max_lba;
- attach->max_xfer = (sdev->host->max_sectors * 512) / gli->blk_len;
+ attach->max_xfer = (sdev->host->max_sectors * MAX_SECTOR_UNIT) /
+ gli->blk_len;
out:
attach->adap_fd = fd;