]> git.baikalelectronics.ru Git - kernel.git/commit
osd: fix signed char versus %02x issue
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 8 Dec 2015 14:25:16 +0000 (15:25 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 10 Dec 2015 18:14:56 +0000 (13:14 -0500)
commit45c9d4daac545d9192bc2b3ad5512c5190e71958
tree72523d992745d7ed06c35eeb4d5acbcc89a91dcb
parenta341f16de3a5bda919eb5b13b0124ffc7ddd0e15
osd: fix signed char versus %02x issue

If char is signed and one of these bytes happen to have a value outside
the ascii range, the corresponding output will consist of "ffffff"
followed by the two hex chars that were actually intended. One way to
fix it would be to change the casts to (u8*) aka
(unsigned char*), but it is much simpler (and generates smaller code)
to use the %ph extension which was created for such short hexdumps.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Boaz Harrosh <ooo@electrozaur.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/osd/osd_initiator.c