diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-07-01 00:39:01 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-07-01 00:39:01 +0000 |
commit | 2dea677bb4c6566e0eff244777fd89cc6a3996f7 (patch) | |
tree | 064d2bc75762148c5fb60705733282e64bf50f0e /ichspi.c | |
parent | f00396e4b0b71ccbd2cc2e13b35bef1006101b8f (diff) | |
download | flashrom-2dea677bb4c6566e0eff244777fd89cc6a3996f7.tar.gz |
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.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1359 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'ichspi.c')
-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); |