public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] board/esd/cpci405/cpci405.c: Fix GCC 4.6 warning
@ 2011-11-24 15:39 Matthias Fuchs
  2011-11-24 17:05 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Matthias Fuchs @ 2011-11-24 15:39 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
---
 board/esd/cpci405/cpci405.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index 98a8584..41b5ba0 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -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);
 
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-07 20:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24 15:39 [U-Boot] [PATCH] board/esd/cpci405/cpci405.c: Fix GCC 4.6 warning Matthias Fuchs
2011-11-24 17:05 ` Marek Vasut
2011-11-24 17:40 ` Mike Frysinger
2011-11-25  8:33   ` Marek Vasut
2011-11-25 19:56     ` Mike Frysinger
2011-11-25 12:50   ` Matthias Fuchs
2011-12-07 20:22 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox