1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

ichspi.c: make REGWRITE* macros safer

'+' does have a quite high precedence so "calling" those macros with a
term including weaker operators in the off parameter may have unexpected
consequences.

Corresponding to flashrom svn r1359.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
Stefan Tauner 2011-07-01 00:39:01 +00:00
parent 5368dca436
commit ccd92a19d4

View File

@ -216,9 +216,9 @@ static uint16_t REGREAD8(int X)
return mmio_readb(ich_spibar + X);
}
#define REGWRITE32(off,val) mmio_writel(val, ich_spibar+off)
#define REGWRITE16(off,val) mmio_writew(val, ich_spibar+off)
#define REGWRITE8(off,val) mmio_writeb(val, ich_spibar+off)
#define REGWRITE32(off, val) mmio_writel(val, ich_spibar+(off))
#define REGWRITE16(off, val) mmio_writew(val, ich_spibar+(off))
#define REGWRITE8(off, val) mmio_writeb(val, ich_spibar+(off))
/* Common SPI functions */
static int find_opcode(OPCODES *op, uint8_t opcode);