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 <[EMAIL PROTECTED]>
---
 common/cmd_spi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/common/cmd_spi.c b/common/cmd_spi.c
index 40ee7e7..1f0727b 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");
        }
-- 
1.6.0.1


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to