diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2011-07-01 00:39:01 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2011-07-01 00:39:01 +0000 |
commit | ccd92a19d41322d160298427600f1d1302a934a5 (patch) | |
tree | 064d2bc75762148c5fb60705733282e64bf50f0e | |
parent | 5368dca4363d35d4a67537fc03e1f5d417b87ce5 (diff) | |
download | flashrom-ccd92a19d41322d160298427600f1d1302a934a5.tar.gz flashrom-ccd92a19d41322d160298427600f1d1302a934a5.tar.bz2 flashrom-ccd92a19d41322d160298427600f1d1302a934a5.zip |
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>
-rw-r--r-- | ichspi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |