diff options
author | Hannes Reinecke <hare@suse.de> | 2015-01-08 01:43:45 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 09:44:29 -0500 |
commit | cbba5b0ee4c6c2fc8b78a21d0900099d480cf2e9 (patch) | |
tree | 713262555d1f7ce0a17d99a53922041d98ffd544 /drivers/ata | |
parent | 9e5ed2a5b3662c6f398023042c02aaa527099a3d (diff) |
libata: use __scsi_format_command()
libata already uses an internal buffer, so we should be using
__scsi_format_command() here.
Tested-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-eh.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 3dbec8954c86..9179f1123213 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2482,6 +2482,7 @@ static void ata_eh_link_report(struct ata_link *link) | |||
2482 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); | 2482 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); |
2483 | struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; | 2483 | struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; |
2484 | const u8 *cdb = qc->cdb; | 2484 | const u8 *cdb = qc->cdb; |
2485 | size_t cdb_len = qc->dev->cdb_len; | ||
2485 | char data_buf[20] = ""; | 2486 | char data_buf[20] = ""; |
2486 | char cdb_buf[70] = ""; | 2487 | char cdb_buf[70] = ""; |
2487 | 2488 | ||
@@ -2509,16 +2510,12 @@ static void ata_eh_link_report(struct ata_link *link) | |||
2509 | } | 2510 | } |
2510 | 2511 | ||
2511 | if (ata_is_atapi(qc->tf.protocol)) { | 2512 | if (ata_is_atapi(qc->tf.protocol)) { |
2512 | if (qc->scsicmd) | 2513 | if (qc->scsicmd) { |
2513 | scsi_print_command(qc->scsicmd); | 2514 | cdb = qc->scsicmd->cmnd; |
2514 | else | 2515 | cdb_len = qc->scsicmd->cmd_len; |
2515 | snprintf(cdb_buf, sizeof(cdb_buf), | 2516 | } |
2516 | "cdb %02x %02x %02x %02x %02x %02x %02x %02x " | 2517 | __scsi_format_command(cdb_buf, sizeof(cdb_buf), |
2517 | "%02x %02x %02x %02x %02x %02x %02x %02x\n ", | 2518 | cdb, cdb_len); |
2518 | cdb[0], cdb[1], cdb[2], cdb[3], | ||
2519 | cdb[4], cdb[5], cdb[6], cdb[7], | ||
2520 | cdb[8], cdb[9], cdb[10], cdb[11], | ||
2521 | cdb[12], cdb[13], cdb[14], cdb[15]); | ||
2522 | } else { | 2519 | } else { |
2523 | const char *descr = ata_get_cmd_descript(cmd->command); | 2520 | const char *descr = ata_get_cmd_descript(cmd->command); |
2524 | if (descr) | 2521 | if (descr) |