diff options
author | Fabio Falzoi <fabio.falzoi84@gmail.com> | 2014-08-05 21:24:17 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-16 19:23:13 (GMT) |
commit | 69b8b22489f5edf1fde0d6958ab3881068701e6d (patch) | |
tree | 769ecf638daef818c245f99e42c15f25320a3954 /drivers/staging/rts5208/rtsx_scsi.c | |
parent | 63bc516402c615250ef9e88905b8c78a04fbacdb (diff) | |
download | linux-69b8b22489f5edf1fde0d6958ab3881068701e6d.tar.xz |
Staging: rts5208: Use dev_dbg and print_hex_dump_bytes to dump memory
Use dev_dbg with %*ph format specifier and print_hex_dump_bytes to dump memory
instead of relying on custom macro.
Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208/rtsx_scsi.c')
-rw-r--r-- | drivers/staging/rts5208/rtsx_scsi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index 5f5f512..7e6c7c04 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -39,7 +39,7 @@ void scsi_show_command(struct rtsx_chip *chip) { struct scsi_cmnd *srb = chip->srb; char *what = NULL; - int i, unknown_cmd = 0; + int unknown_cmd = 0, len; switch (srb->cmnd[0]) { case TEST_UNIT_READY: @@ -319,9 +319,8 @@ void scsi_show_command(struct rtsx_chip *chip) what, srb->cmd_len); if (unknown_cmd) { - for (i = 0; i < srb->cmd_len && i < 16; i++) - dev_dbg(rtsx_dev(chip), " %02x", srb->cmnd[i]); - dev_dbg(rtsx_dev(chip), "\n"); + len = min_t(unsigned short, srb->cmd_len, 16); + dev_dbg(rtsx_dev(chip), "%*ph\n", len, srb->cmnd); } } |