summaryrefslogtreecommitdiff
path: root/board/prodrive/pdnb3
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-03-06 01:10:00 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-03-26 23:09:26 +0200
commit44e63c228ea8730af5782d1c29c5bef2e57c9b0e (patch)
tree7b1b3d1174113527a55348efbb6ce2174fb61059 /board/prodrive/pdnb3
parent2152df67c351f167641e0000177c0de746be8665 (diff)
IXP: Fix NAND build warning on PDNB3 and SCPU
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] Remove the 4-byte-at-time read mode altogether, the most is bogus and will likely cause unaligned accesses. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Bryan Hundven <bryanhundven@gmail.com> Cc: Michael Schwingen <rincewind@discworld.dascon.de>
Diffstat (limited to 'board/prodrive/pdnb3')
-rw-r--r--board/prodrive/pdnb3/nand.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/board/prodrive/pdnb3/nand.c b/board/prodrive/pdnb3/nand.c
index 2efe027ec1..6d1f2034c1 100644
--- a/board/prodrive/pdnb3/nand.c
+++ b/board/prodrive/pdnb3/nand.c
@@ -96,16 +96,8 @@ static void pdnb3_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
{
int i;
- if (len % 4) {
- for (i = 0; i < len; i++)
- buf[i] = readb(&(pdnb3_ndfc->data));
- } else {
- ulong *ptr = (ulong *)buf;
- int count = len >> 2;
-
- for (i = 0; i < count; i++)
- *ptr++ = readl(&(pdnb3_ndfc->data));
- }
+ for (i = 0; i < len; i++)
+ buf[i] = readb(&(pdnb3_ndfc->data));
}
static int pdnb3_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
@@ -121,12 +113,10 @@ static int pdnb3_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int le
static int pdnb3_nand_dev_ready(struct mtd_info *mtd)
{
- volatile u_char val;
-
/*
* Blocking read to wait for NAND to be ready
*/
- val = readb(&(pdnb3_ndfc->wait));
+ readb(&(pdnb3_ndfc->wait));
/*
* Return always true