[U-Boot] [PATCH] board/flagadm/flash.c: fix compile warning

Wolfgang Denk wd at denx.de
Fri Sep 11 11:18:19 CEST 2009


Fix warning: flash.c:531: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: Wolfgang Denk <wd at denx.de>
Cc: Kári Davíðsson <kd at flaga.is>
---
 board/flagadm/flash.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/flagadm/flash.c b/board/flagadm/flash.c
index bbefbac..ff37d9e 100644
--- a/board/flagadm/flash.c
+++ b/board/flagadm/flash.c
@@ -528,7 +528,8 @@ int write_word (flash_info_t *info, ulong dest, ulong da)
 	ulong start;
 	char csr;
 	int flag;
-	ushort * d = (ushort*)&da;
+	ulong *dla = &da;
+	ushort *d = (ushort*)dla;
 	int i;
 
 	/* Check if Flash is (sufficiently) erased */
-- 
1.6.0.6



More information about the U-Boot mailing list