scsi: libsas: Tidy SAS address print format
Currently we use a mixture of %016llx, %llx, and %16llx when printing a SAS address. Since the most significant nibble of the SAS address is always 5 - as per standard - this formatting is not so important; but some fake SAS addresses for SATA devices may not be. And we have mangled/invalid address to consider also. And it's better to be consistent in the code, so use a fixed format. The SAS address is a fixed size at 64b, so we want to 0 byte extend to 16 nibbles, so use %016llx globally. Also make some prints to be explicitly hex, and tidy some whitespace issue. Link: https://lore.kernel.org/r/1576758957-227350-1-git-send-email-john.garry@huawei.com Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:

committed by
Martin K. Petersen

parent
6d67e84733
commit
b3e3d4c618
@@ -330,7 +330,7 @@ static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd)
|
||||
|
||||
int_to_scsilun(cmd->device->lun, &lun);
|
||||
|
||||
pr_notice("eh: device %llx LUN %llx has the task\n",
|
||||
pr_notice("eh: device %016llx LUN 0x%llx has the task\n",
|
||||
SAS_ADDR(dev->sas_addr),
|
||||
cmd->device->lun);
|
||||
|
||||
@@ -615,7 +615,7 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
|
||||
reset:
|
||||
tmf_resp = sas_recover_lu(task->dev, cmd);
|
||||
if (tmf_resp == TMF_RESP_FUNC_COMPLETE) {
|
||||
pr_notice("dev %016llx LU %llx is recovered\n",
|
||||
pr_notice("dev %016llx LU 0x%llx is recovered\n",
|
||||
SAS_ADDR(task->dev),
|
||||
cmd->device->lun);
|
||||
sas_eh_finish_cmd(cmd);
|
||||
@@ -666,7 +666,7 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
|
||||
* of effort could recover from errors. Quite
|
||||
* possibly the HA just disappeared.
|
||||
*/
|
||||
pr_err("error from device %llx, LUN %llx couldn't be recovered in any way\n",
|
||||
pr_err("error from device %016llx, LUN 0x%llx couldn't be recovered in any way\n",
|
||||
SAS_ADDR(task->dev->sas_addr),
|
||||
cmd->device->lun);
|
||||
|
||||
@@ -851,7 +851,7 @@ int sas_slave_configure(struct scsi_device *scsi_dev)
|
||||
if (scsi_dev->tagged_supported) {
|
||||
scsi_change_queue_depth(scsi_dev, SAS_DEF_QD);
|
||||
} else {
|
||||
pr_notice("device %llx, LUN %llx doesn't support TCQ\n",
|
||||
pr_notice("device %016llx, LUN 0x%llx doesn't support TCQ\n",
|
||||
SAS_ADDR(dev->sas_addr), scsi_dev->lun);
|
||||
scsi_change_queue_depth(scsi_dev, 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user