]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board/esd/cpci405/cpci405.c: Fix GCC 4.6 warning
authorMatthias Fuchs <matthias.fuchs@esd.eu>
Thu, 24 Nov 2011 05:39:21 +0000 (05:39 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 7 Dec 2011 20:20:00 +0000 (21:20 +0100)
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
board/esd/cpci405/cpci405.c

index 98a8584156b5f9f31e3345f02a28dc2bd177a4b1..41b5ba0490673c737f5e76181b20ff5f82f459f6 100644 (file)
@@ -656,7 +656,6 @@ int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        int i;
        unsigned char ow_id[6];
        char str[32];
-       unsigned char ow_crc;
 
        /*
         * Clear 1-wire bit (open drain with pull-up)
@@ -675,11 +674,10 @@ int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        OWReadByte(); /* skip family code ( == 0x01) */
        for (i = 0; i < 6; i++)
                ow_id[i] = OWReadByte();
-       ow_crc = OWReadByte(); /* read crc */
+       OWReadByte(); /* read crc */
 
-       sprintf(str, "%08X%04X",
-               *(unsigned int *)&ow_id[0],
-               *(unsigned short *)&ow_id[4]);
+       sprintf(str, "%02X%02X%02X%02X%02X%02X",
+               ow_id[0], ow_id[1], ow_id[2], ow_id[3], ow_id[4], ow_id[5]);
        printf("Setting environment variable 'ow_id' to %s\n", str);
        setenv("ow_id", str);