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>
{
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)
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