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>
This commit is contained in:
Manoj Kumar
2015-10-21 15:11:00 -05:00
committed by James Bottomley
parent fa4aa632da
commit 3ebf203093
3 changed files with 9 additions and 3 deletions

View File

@@ -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;