aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDenis Cheng <crquan@gmail.com>2007-11-27 15:35:58 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-27 15:35:58 -0500
commit6413f08666830afec21e41e50c28a2c5105ede69 (patch)
tree4b8fdb75f63d1063c9bb581dd53a7fa0e246575b /drivers/scsi
parente97564f362a93f8c248246c19828895950341252 (diff)
ide-scsi: use print_hex_dump from <linux/kernel.h>
these utilities implemented in lib/hexdump.c are more handy, please use this. Bart: - s/KERN_DEBUG/KERN_CONT/ as pointed out by Randy - s/DUMP_PREFIX_OFFSET/DUMP_PREFIX_NONE/ - don't include ASCII dump - respect 80-columns limit Signed-off-by: Denis Cheng <crquan@gmail.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ide-scsi.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 8d0244c2e7d4..7a835a35f21d 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -242,16 +242,6 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
242 } 242 }
243} 243}
244 244
245static void hexdump(u8 *x, int len)
246{
247 int i;
248
249 printk("[ ");
250 for (i = 0; i < len; i++)
251 printk("%x ", x[i]);
252 printk("]\n");
253}
254
255static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_command) 245static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_command)
256{ 246{
257 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 247 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
@@ -282,7 +272,8 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co
282 pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd; 272 pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
283 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { 273 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
284 printk ("ide-scsi: %s: queue cmd = ", drive->name); 274 printk ("ide-scsi: %s: queue cmd = ", drive->name);
285 hexdump(pc->c, 6); 275 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, pc->c,
276 6, 0);
286 } 277 }
287 rq->rq_disk = scsi->disk; 278 rq->rq_disk = scsi->disk;
288 return ide_do_drive_cmd(drive, rq, ide_preempt); 279 return ide_do_drive_cmd(drive, rq, ide_preempt);
@@ -337,7 +328,8 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
337 idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer; 328 idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer;
338 if (log) { 329 if (log) {
339 printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number); 330 printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number);
340 hexdump(pc->buffer,16); 331 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1,
332 pc->buffer, 16, 0);
341 } 333 }
342 memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE); 334 memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE);
343 kfree(pc->buffer); 335 kfree(pc->buffer);
@@ -816,10 +808,12 @@ static int idescsi_queue (struct scsi_cmnd *cmd,
816 808
817 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { 809 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
818 printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); 810 printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number);
819 hexdump(cmd->cmnd, cmd->cmd_len); 811 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1,
812 cmd->cmnd, cmd->cmd_len, 0);
820 if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) { 813 if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) {
821 printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number); 814 printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number);
822 hexdump(pc->c, 12); 815 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1,
816 pc->c, 12, 0);
823 } 817 }
824 } 818 }
825 819