Skip to contentSkip to conversation

libata-scsi: use %*ph to dump small buffers

PATCH Applied Andy Shevchenko 2 participants 2 messages May 6, 2016 – May 9, 2016 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata-scsi: use %*ph to dump small buffers

Replace custom approach by %*ph specifier to dump small buffers in hex format.

---
 drivers/ata/libata-scsi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ata/libata-scsi.c +2 -5
index c7d0fc1..5bef807 100644
@@ -3646,14 +3646,11 @@ static inline void ata_scsi_dump_cdb(struct ata_port *ap,
 {
 #ifdef ATA_DEBUG
 	struct scsi_device *scsidev = cmd->device;
-	u8 *scsicmd = cmd->cmnd;
 
-	DPRINTK("CDB (%u:%d,%d,%d) %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+	DPRINTK("CDB (%u:%d,%d,%d) %9ph\n",
 		ap->print_id,
 		scsidev->channel, scsidev->id, scsidev->lun,
-		scsicmd[0], scsicmd[1], scsicmd[2], scsicmd[3],
-		scsicmd[4], scsicmd[5], scsicmd[6], scsicmd[7],
-		scsicmd[8]);
+		cmd->cmnd);
 #endif
 }
 
Signature · 1 line
2.8.1
Applied
#1 lore raw
Quoted 3 lines · Andy Shevchenko

Replace custom approach by %*ph specifier to dump small buffers in hex format.

Applied to libata/for-4.7.

Thanks.

Signature · 1 line
tejun