
29 May
2009
29 May
'09
1:06 a.m.
Dear Ilya Yanok,
In message 1242777361-6717-5-git-send-email-yanok@emcraft.com you wrote:
Driver for NFC NAND controller found on Freescale's MX2 and MX3 processors. Ported from Linux. Tested only with i.MX27 but should works with other MX2 and MX3 processors too.
...
+static void *mxc_nand_memcpy(void *dest, void *source, size_t size) +{
- uint32_t *s = source, *d = dest;
- size >>= 2;
- while (size--)
*d++ = *s++;
- return dest;
+}
Why do we need this "special" function here? Why cannot we use plain standard memcpy() instead?
- if (col < mtd->writesize)
p = (uint16_t __iomem *)(host->regs->MAIN_AREA0 + (col >> 1));
- else
p = (uint16_t __iomem *)(host->regs->SPARE_AREA0 +
((col - mtd->writesize) >> 1));
Braces,please.
...
if (col < mtd->writesize)
p = host->regs->MAIN_AREA0 + (col & ~3);
else
p = host->regs->SPARE_AREA0 -
mtd->writesize + (col & ~3);
Braces, please.
[please check globally, I will not send more of these comments.]
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If all you have is a hammer, everything looks like a nail.