]> git.sur5r.net Git - u-boot/commit
ARM: fix write*() I/O accessors
authorWolfgang Denk <wd@denx.de>
Fri, 11 Feb 2011 12:25:48 +0000 (12:25 +0000)
committerAlbert Aribaud <albert.aribaud@free.fr>
Mon, 21 Feb 2011 07:30:55 +0000 (08:30 +0100)
commit495df3bad9f250a36470cce15f14c36c616172b6
treecb5c1c1f3a4aab72b37538b527096fea076c3def
parent6087f1a90cb2f275752496229b96f0e00aa0a7cd
ARM: fix write*() I/O accessors

Commit 3c0659b "ARM: Avoid compiler optimization for readb, writeb
and friends." introduced I/O accessors with memory barriers.
Unfortunately the new write*() accessors introduced a bug:

The problem is that the argument "v" gets evaluated twice.  This
breaks code like used here (from "drivers/net/dnet.c"):

for (i = 0; i < wrsz; i++)
writel(*bufp++, &dnet->regs->TX_DATA_FIFO);

Use auxiliary variables to avoid such problems.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Albert Aribaud <albert.aribaud@free.fr>
Cc: Alexander Holler <holler@ahsoftware.de>
Cc: Dirk Behme <dirk.behme@googlemail.com>
arch/arm/include/asm/io.h