Commit cbba5b0e authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Christoph Hellwig

libata: use __scsi_format_command()

libata already uses an internal buffer, so we should be using
__scsi_format_command() here.
Tested-by: default avatarRobert Elliott <elliott@hp.com>
Reviewed-by: default avatarRobert Elliott <elliott@hp.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 9e5ed2a5
...@@ -2482,6 +2482,7 @@ static void ata_eh_link_report(struct ata_link *link) ...@@ -2482,6 +2482,7 @@ static void ata_eh_link_report(struct ata_link *link)
struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
const u8 *cdb = qc->cdb; const u8 *cdb = qc->cdb;
size_t cdb_len = qc->dev->cdb_len;
char data_buf[20] = ""; char data_buf[20] = "";
char cdb_buf[70] = ""; char cdb_buf[70] = "";
...@@ -2509,16 +2510,12 @@ static void ata_eh_link_report(struct ata_link *link) ...@@ -2509,16 +2510,12 @@ static void ata_eh_link_report(struct ata_link *link)
} }
if (ata_is_atapi(qc->tf.protocol)) { if (ata_is_atapi(qc->tf.protocol)) {
if (qc->scsicmd) if (qc->scsicmd) {
scsi_print_command(qc->scsicmd); cdb = qc->scsicmd->cmnd;
else cdb_len = qc->scsicmd->cmd_len;
snprintf(cdb_buf, sizeof(cdb_buf), }
"cdb %02x %02x %02x %02x %02x %02x %02x %02x " __scsi_format_command(cdb_buf, sizeof(cdb_buf),
"%02x %02x %02x %02x %02x %02x %02x %02x\n ", cdb, cdb_len);
cdb[0], cdb[1], cdb[2], cdb[3],
cdb[4], cdb[5], cdb[6], cdb[7],
cdb[8], cdb[9], cdb[10], cdb[11],
cdb[12], cdb[13], cdb[14], cdb[15]);
} else { } else {
const char *descr = ata_get_cmd_descript(cmd->command); const char *descr = ata_get_cmd_descript(cmd->command);
if (descr) if (descr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment