diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:53 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:09:13 -0400 |
commit | 6ddc8cf40a2011af0c1a5dd300cc75d727c3c3a8 (patch) | |
tree | 58018e956510dd1b01bbf076dfb9fe286e946184 /drivers/scsi | |
parent | fde1fb8a4a74607c82a47389be9ee3a134c854cb (diff) |
aha1542: Use print_hex_dump_bytes in debug code
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aha1542.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 6d4532c5185e..87017fbdbc84 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -381,14 +381,8 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
381 | if (errstatus) | 381 | if (errstatus) |
382 | shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus, | 382 | shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus, |
383 | ccb[mbo].hastat, ccb[mbo].tarstat); | 383 | ccb[mbo].hastat, ccb[mbo].tarstat); |
384 | if (ccb[mbo].tarstat == 2) { | 384 | if (ccb[mbo].tarstat == 2) |
385 | int i; | 385 | print_hex_dump_bytes("sense: ", DUMP_PREFIX_NONE, &ccb[mbo].cdb[ccb[mbo].cdblen], 12); |
386 | |||
387 | printk("aha1542_intr_handle: sense:"); | ||
388 | for (i = 0; i < 12; i++) | ||
389 | printk("%02x ", ccb[mbo].cdb[ccb[mbo].cdblen + i]); | ||
390 | printk("\n"); | ||
391 | } | ||
392 | if (errstatus) | 386 | if (errstatus) |
393 | printk("aha1542_intr_handle: returning %6x\n", errstatus); | 387 | printk("aha1542_intr_handle: returning %6x\n", errstatus); |
394 | #endif | 388 | #endif |
@@ -450,10 +444,7 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
450 | shost_printk(KERN_DEBUG, sh, "aha1542_queuecommand: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); | 444 | shost_printk(KERN_DEBUG, sh, "aha1542_queuecommand: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); |
451 | else | 445 | else |
452 | shost_printk(KERN_DEBUG, sh, "aha1542_command: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); | 446 | shost_printk(KERN_DEBUG, sh, "aha1542_command: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); |
453 | shost_printk(KERN_DEBUG, sh, "aha1542_queuecommand: dumping scsi cmd:"); | 447 | print_hex_dump_bytes("command: ", DUMP_PREFIX_NONE, cmd->cmnd, cmd->cmd_len); |
454 | for (i = 0; i < cmd->cmd_len; i++) | ||
455 | printk("%02x ", cmd->cmnd[i]); | ||
456 | printk("\n"); | ||
457 | if (*cmd->cmnd == WRITE_10 || *cmd->cmnd == WRITE_6) | 448 | if (*cmd->cmnd == WRITE_10 || *cmd->cmnd == WRITE_6) |
458 | return 0; /* we are still testing, so *don't* write */ | 449 | return 0; /* we are still testing, so *don't* write */ |
459 | #endif | 450 | #endif |
@@ -483,7 +474,7 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
483 | spin_unlock_irqrestore(&aha1542_lock, flags); | 474 | spin_unlock_irqrestore(&aha1542_lock, flags); |
484 | 475 | ||
485 | #ifdef DEBUG | 476 | #ifdef DEBUG |
486 | shost_printk(KERN_DEBUG, sh, "Sending command (%d %x)...", mbo, done); | 477 | shost_printk(KERN_DEBUG, sh, "Sending command (%d %p)...", mbo, done); |
487 | #endif | 478 | #endif |
488 | 479 | ||
489 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ | 480 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ |
@@ -503,10 +494,8 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
503 | if (bufflen) { | 494 | if (bufflen) { |
504 | struct scatterlist *sg; | 495 | struct scatterlist *sg; |
505 | struct chain *cptr; | 496 | struct chain *cptr; |
506 | #ifdef DEBUG | ||
507 | unsigned char *ptr; | ||
508 | #endif | ||
509 | int i, sg_count = scsi_sg_count(cmd); | 497 | int i, sg_count = scsi_sg_count(cmd); |
498 | |||
510 | ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ | 499 | ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ |
511 | cmd->host_scribble = kmalloc(sizeof(*cptr)*sg_count, | 500 | cmd->host_scribble = kmalloc(sizeof(*cptr)*sg_count, |
512 | GFP_KERNEL | GFP_DMA); | 501 | GFP_KERNEL | GFP_DMA); |
@@ -524,10 +513,8 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
524 | any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); | 513 | any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); |
525 | any2scsi(ccb[mbo].dataptr, isa_virt_to_bus(cptr)); | 514 | any2scsi(ccb[mbo].dataptr, isa_virt_to_bus(cptr)); |
526 | #ifdef DEBUG | 515 | #ifdef DEBUG |
527 | printk("cptr %x: ", cptr); | 516 | shost_printk(KERN_DEBUG, sh, "cptr %p: ", cptr); |
528 | ptr = (unsigned char *) cptr; | 517 | print_hex_dump_bytes("cptr: ", DUMP_PREFIX_NONE, cptr, 18); |
529 | for (i = 0; i < 18; i++) | ||
530 | printk("%02x ", ptr[i]); | ||
531 | #endif | 518 | #endif |
532 | } else { | 519 | } else { |
533 | ccb[mbo].op = 0; /* SCSI Initiator Command */ | 520 | ccb[mbo].op = 0; /* SCSI Initiator Command */ |
@@ -541,12 +528,7 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
541 | ccb[mbo].commlinkid = 0; | 528 | ccb[mbo].commlinkid = 0; |
542 | 529 | ||
543 | #ifdef DEBUG | 530 | #ifdef DEBUG |
544 | { | 531 | print_hex_dump_bytes("sending: ", DUMP_PREFIX_NONE, &ccb[mbo], sizeof(ccb[mbo]) - 10); |
545 | int i; | ||
546 | shost_printk(KERN_DEBUG, sh, "aha1542_command: sending.. "); | ||
547 | for (i = 0; i < sizeof(ccb[mbo]) - 10; i++) | ||
548 | printk("%02x ", ((u8 *) &ccb[mbo])[i]); | ||
549 | }; | ||
550 | #endif | 532 | #endif |
551 | 533 | ||
552 | if (done) { | 534 | if (done) { |