From: Mike Frysinger Date: Tue, 14 Oct 2008 11:04:38 +0000 (-0400) Subject: cmd_spi: remove broken signed casting for display X-Git-Tag: v2008.10-rc3~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c46980f6d2135ade345dadc1fb1f1f4c8bbf255a;p=u-boot cmd_spi: remove broken signed casting for display Since we're working with unsigned data, you can't apply a signed pointer cast and then attempt to print the result. Otherwise you get wrong output when the sign bit is set like "0xFF" incorrectly extended to "0xFFFFFFFF". Signed-off-by: Mike Frysinger --- diff --git a/common/cmd_spi.c b/common/cmd_spi.c index 40ee7e7dd3..1f0727b4a2 100644 --- a/common/cmd_spi.c +++ b/common/cmd_spi.c @@ -123,9 +123,8 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf("Error with the SPI transaction.\n"); rcode = 1; } else { - cp = (char *)din; for(j = 0; j < ((bitlen + 7) / 8); j++) { - printf("%02X", *cp++); + printf("%02X", din[j]); } printf("\n"); }