diff options
author | mkarcher <mkarcher@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-01-12 15:36:24 +0000 |
---|---|---|
committer | mkarcher <mkarcher@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-01-12 15:36:24 +0000 |
commit | 97839cf57726d20153b4a8009d112e48079834cd (patch) | |
tree | 0de6c940c2288444810f571fabe0687c7e1ba40a /hwaccess.h | |
parent | 066fe6553bea25e06566b79472524d02dbfdf373 (diff) | |
download | flashrom-97839cf57726d20153b4a8009d112e48079834cd.tar.gz |
Enable -Wshadow, clean code for that
This is not just for fun. We hit a real bug on BSD with the outl macros.
The macro variable tmp collided with the tmp from outer scope.
second revision, now also taking care of inb/inw/inl. While that shadowing
did not introduce bugs (yet), of course it breaks the build on BSD when
-Wshadow is enabled.
Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Luc Verhaegen <libv@skynet.be>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@860 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'hwaccess.h')
-rw-r--r-- | hwaccess.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -46,12 +46,12 @@ #include <machine/cpufunc.h> #define off64_t off_t #define lseek64 lseek - #define OUTB(x, y) do { u_int tmp = (y); outb(tmp, (x)); } while (0) - #define OUTW(x, y) do { u_int tmp = (y); outw(tmp, (x)); } while (0) - #define OUTL(x, y) do { u_int tmp = (y); outl(tmp, (x)); } while (0) - #define INB(x) __extension__ ({ u_int tmp = (x); inb(tmp); }) - #define INW(x) __extension__ ({ u_int tmp = (x); inw(tmp); }) - #define INL(x) __extension__ ({ u_int tmp = (x); inl(tmp); }) + #define OUTB(x, y) do { u_int outb_tmp = (y); outb(outb_tmp, (x)); } while (0) + #define OUTW(x, y) do { u_int outw_tmp = (y); outw(outw_tmp, (x)); } while (0) + #define OUTL(x, y) do { u_int outl_tmp = (y); outl(outl_tmp, (x)); } while (0) + #define INB(x) __extension__ ({ u_int inb_tmp = (x); inb(inb_tmp); }) + #define INW(x) __extension__ ({ u_int inw_tmp = (x); inw(inw_tmp); }) + #define INL(x) __extension__ ({ u_int inl_tmp = (x); inl(inl_tmp); }) #else #if defined(__DARWIN__) #include <DirectIO/darwinio.h> |