nand.c: In function ‘pdnb3_nand_read_buf’:
nand.c:107:4: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
nand.c: In function ‘pdnb3_nand_dev_ready’:
nand.c:124:18: warning: variable ‘val’ set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Bryan Hundven <bryanhund...@gmail.com>
Cc: Michael Schwingen <rincew...@discworld.dascon.de>
---
 board/prodrive/pdnb3/nand.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/board/prodrive/pdnb3/nand.c b/board/prodrive/pdnb3/nand.c
index 2efe027..656fafe 100644
--- a/board/prodrive/pdnb3/nand.c
+++ b/board/prodrive/pdnb3/nand.c
@@ -100,11 +100,14 @@ static void pdnb3_nand_read_buf(struct mtd_info *mtd, 
u_char *buf, int len)
                for (i = 0; i < len; i++)
                        buf[i] = readb(&(pdnb3_ndfc->data));
        } else {
-               ulong *ptr = (ulong *)buf;
+               uint32_t data;
                int count = len >> 2;
 
-               for (i = 0; i < count; i++)
-                       *ptr++ = readl(&(pdnb3_ndfc->data));
+               for (i = 0; i < count; i++) {
+                       data = readl(&pdnb3_ndfc->data);
+                       memcpy(buf, &data, 4);
+                       buf += 4;
+               }
        }
 }
 
-- 
1.7.9

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to