Commit fb55d887 authored by Takashi Iwai's avatar Takashi Iwai Committed by John W. Linville

ipw2200 - Fix bad ipw_write8() macro

ipw_write8() can't be used alone with a loop because of a wrong definition.

  CC [M]  drivers/net/wireless/ipw2200.o
drivers/net/wireless/ipw2200.c: In function 'ipw_ethtool_set_eeprom':
drivers/net/wireless/ipw2200.c:10579: warning: array subscript is above array bounds
drivers/net/wireless/ipw2200.c: In function 'ipw_load':
drivers/net/wireless/ipw2200.c:2663: warning: array subscript is above array bounds

Add missing do {} while (0) to fix them.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7dcdd073
......@@ -305,9 +305,10 @@ static inline void ipw_write_reg32(struct ipw_priv *a, u32 b, u32 c)
#define _ipw_write8(ipw, ofs, val) writeb((val), (ipw)->hw_base + (ofs))
/* 8-bit direct write (for low 4K of SRAM/regs), with debug wrapper */
#define ipw_write8(ipw, ofs, val) \
#define ipw_write8(ipw, ofs, val) do { \
IPW_DEBUG_IO("%s %d: write_direct8(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \
_ipw_write8(ipw, ofs, val)
_ipw_write8(ipw, ofs, val); \
} while (0)
/* 16-bit direct write (low 4K) */
#define _ipw_write16(ipw, ofs, val) writew((val), (ipw)->hw_base + (ofs))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment