Re: [PATCH 2/2] ide-scsi: use print_hex_dump from <linux/kernel.h>

From: rae l
Date: Mon Nov 26 2007 - 03:38:12 EST


On Nov 26, 2007 3:41 PM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> On Mon, 2007-11-26 at 15:16 +0800, Denis Cheng wrote:
> > diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
> > index 8d0244c..8f3fc1d 100644
> > --- a/drivers/scsi/ide-scsi.c
> > +++ b/drivers/scsi/ide-scsi.c
> > @@ -282,7 +272,7 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co
> > pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
> > if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
> > printk ("ide-scsi: %s: queue cmd = ", drive->name);
> > - hexdump(pc->c, 6);
> > + print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, pc->c, 6, 1);
> > }
> > rq->rq_disk = scsi->disk;
> > return ide_do_drive_cmd(drive, rq, ide_preempt);
>
> Hi Denis.
>
> These aren't really equivalent. You need to look at the
> line above to determine if a KERN_ prefix needs to be
> used at all.
>
> You should probably use print_hex_dump_bytes here.
I know this is different from the original hexdump in ide-scsi.c, I
just want to tell someone that there's a good implementation of
hexdump in kernel.h, and I think the default KERN_DEBUG and
print_hex_dump is more informative and has better output. However,
anyone want more precise control on debug message could make her/his
improvements with print_hex_dump.

>
> cheers, Joe
>
>

--
Denis Cheng
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/