Re: [PATCH 2/2] mtd: orion-nand: fix build error with ARMv4

From: Geert Uytterhoeven
Date: Fri May 09 2014 - 15:29:24 EST


On Fri, May 9, 2014 at 8:45 PM, Ezequiel Garcia
<ezequiel.garcia@xxxxxxxxxxxxxxxxxx> wrote:
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -52,6 +52,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
> uint64_t *buf64;
> int i = 0;
>
> +#if __LINUX_ARM_ARCH__ >= 5
> while (len && (unsigned long)buf & 7) {
> *buf++ = readb(io_base);
> len--;
> @@ -69,6 +70,14 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
> buf64[i++] = x;
> }
> i *= 8;
> +#else
> + while (len && (unsigned long)buf & 3) {
> + *buf++ = readb(io_base);
> + len--;
> + }
> + readsl(io_base, buf, len/4);
> + i = (len / 4 * 4) * 4;

Why multiply by 4 twice? "i" is supposed to be the number of bytes read,
right?

BTW, Arnd's version should just need s/8/4/g to make it work.

> +#endif
> while (i < len)
> buf[i++] = readb(io_base);
> }

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/