diff options
author | Joe Perches <joe@perches.com> | 2012-04-03 17:46:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-11 16:23:56 -0400 |
commit | da951c2417ec1020d0d00813da36f38e395994e9 (patch) | |
tree | 65404e5b7e22c2fbaa8ac0609213404c47b60cf5 | |
parent | 150721894e3613a228e212615909ade14964235c (diff) |
wireless: Remove unnecessary ; from while (0) macros
Semicolons are not necessary after macros that end in while (0).
Remove them.
Simplify the macros with tests of
do { if (foo>size) memset1; else memset2;} while (0);
to a single line memset(,,min_t(size_t, foo, size))
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/carl9170/cmd.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/d11.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sdio.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/trx.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/trx.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/def.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/fw.h | 6 |
7 files changed, 15 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/carl9170/cmd.h b/drivers/net/wireless/ath/carl9170/cmd.h index 885c42778b8b..65919c902f55 100644 --- a/drivers/net/wireless/ath/carl9170/cmd.h +++ b/drivers/net/wireless/ath/carl9170/cmd.h | |||
@@ -114,7 +114,7 @@ __regwrite_out : \ | |||
114 | 114 | ||
115 | #define carl9170_regwrite_result() \ | 115 | #define carl9170_regwrite_result() \ |
116 | __err; \ | 116 | __err; \ |
117 | } while (0); | 117 | } while (0) |
118 | 118 | ||
119 | 119 | ||
120 | #define carl9170_async_regwrite_get_buf() \ | 120 | #define carl9170_async_regwrite_get_buf() \ |
@@ -126,7 +126,7 @@ do { \ | |||
126 | __err = -ENOMEM; \ | 126 | __err = -ENOMEM; \ |
127 | goto __async_regwrite_out; \ | 127 | goto __async_regwrite_out; \ |
128 | } \ | 128 | } \ |
129 | } while (0); | 129 | } while (0) |
130 | 130 | ||
131 | #define carl9170_async_regwrite_begin(carl) \ | 131 | #define carl9170_async_regwrite_begin(carl) \ |
132 | do { \ | 132 | do { \ |
@@ -169,6 +169,6 @@ __async_regwrite_out: \ | |||
169 | 169 | ||
170 | #define carl9170_async_regwrite_result() \ | 170 | #define carl9170_async_regwrite_result() \ |
171 | __err; \ | 171 | __err; \ |
172 | } while (0); | 172 | } while (0) |
173 | 173 | ||
174 | #endif /* __CMD_H */ | 174 | #endif /* __CMD_H */ |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/d11.h b/drivers/net/wireless/brcm80211/brcmsmac/d11.h index 1948cb2771e9..3f659e09f1cc 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/d11.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/d11.h | |||
@@ -733,7 +733,7 @@ struct cck_phy_hdr { | |||
733 | do { \ | 733 | do { \ |
734 | plcp[1] = len & 0xff; \ | 734 | plcp[1] = len & 0xff; \ |
735 | plcp[2] = ((len >> 8) & 0xff); \ | 735 | plcp[2] = ((len >> 8) & 0xff); \ |
736 | } while (0); | 736 | } while (0) |
737 | 737 | ||
738 | #define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU) | 738 | #define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU) |
739 | #define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU) | 739 | #define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU) |
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h index a3fb322205b0..0ead152e3d1e 100644 --- a/drivers/net/wireless/mwifiex/sdio.h +++ b/drivers/net/wireless/mwifiex/sdio.h | |||
@@ -193,7 +193,7 @@ | |||
193 | a->mpa_tx.ports |= (1<<(a->mpa_tx.pkt_cnt+1+(MAX_PORT - \ | 193 | a->mpa_tx.ports |= (1<<(a->mpa_tx.pkt_cnt+1+(MAX_PORT - \ |
194 | a->mp_end_port))); \ | 194 | a->mp_end_port))); \ |
195 | a->mpa_tx.pkt_cnt++; \ | 195 | a->mpa_tx.pkt_cnt++; \ |
196 | } while (0); | 196 | } while (0) |
197 | 197 | ||
198 | /* SDIO Tx aggregation limit ? */ | 198 | /* SDIO Tx aggregation limit ? */ |
199 | #define MP_TX_AGGR_PKT_LIMIT_REACHED(a) \ | 199 | #define MP_TX_AGGR_PKT_LIMIT_REACHED(a) \ |
@@ -211,7 +211,7 @@ | |||
211 | a->mpa_tx.buf_len = 0; \ | 211 | a->mpa_tx.buf_len = 0; \ |
212 | a->mpa_tx.ports = 0; \ | 212 | a->mpa_tx.ports = 0; \ |
213 | a->mpa_tx.start_port = 0; \ | 213 | a->mpa_tx.start_port = 0; \ |
214 | } while (0); | 214 | } while (0) |
215 | 215 | ||
216 | /* SDIO Rx aggregation limit ? */ | 216 | /* SDIO Rx aggregation limit ? */ |
217 | #define MP_RX_AGGR_PKT_LIMIT_REACHED(a) \ | 217 | #define MP_RX_AGGR_PKT_LIMIT_REACHED(a) \ |
@@ -242,7 +242,7 @@ | |||
242 | a->mpa_rx.skb_arr[a->mpa_rx.pkt_cnt] = skb; \ | 242 | a->mpa_rx.skb_arr[a->mpa_rx.pkt_cnt] = skb; \ |
243 | a->mpa_rx.len_arr[a->mpa_rx.pkt_cnt] = skb->len; \ | 243 | a->mpa_rx.len_arr[a->mpa_rx.pkt_cnt] = skb->len; \ |
244 | a->mpa_rx.pkt_cnt++; \ | 244 | a->mpa_rx.pkt_cnt++; \ |
245 | } while (0); | 245 | } while (0) |
246 | 246 | ||
247 | /* Reset SDIO Rx aggregation buffer parameters */ | 247 | /* Reset SDIO Rx aggregation buffer parameters */ |
248 | #define MP_RX_AGGR_BUF_RESET(a) do { \ | 248 | #define MP_RX_AGGR_BUF_RESET(a) do { \ |
@@ -250,7 +250,7 @@ | |||
250 | a->mpa_rx.buf_len = 0; \ | 250 | a->mpa_rx.buf_len = 0; \ |
251 | a->mpa_rx.ports = 0; \ | 251 | a->mpa_rx.ports = 0; \ |
252 | a->mpa_rx.start_port = 0; \ | 252 | a->mpa_rx.start_port = 0; \ |
253 | } while (0); | 253 | } while (0) |
254 | 254 | ||
255 | 255 | ||
256 | /* data structure for SDIO MPA TX */ | 256 | /* data structure for SDIO MPA TX */ |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h index efb9ab270403..c4adb9777365 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h | |||
@@ -530,12 +530,7 @@ | |||
530 | SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val) | 530 | SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val) |
531 | 531 | ||
532 | #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ | 532 | #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ |
533 | do { \ | 533 | memset(__pdesc, 0, min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET)) |
534 | if (_size > TX_DESC_NEXT_DESC_OFFSET) \ | ||
535 | memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \ | ||
536 | else \ | ||
537 | memset(__pdesc, 0, _size); \ | ||
538 | } while (0); | ||
539 | 534 | ||
540 | struct rx_fwinfo_92c { | 535 | struct rx_fwinfo_92c { |
541 | u8 gain_trsw[4]; | 536 | u8 gain_trsw[4]; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h index 0dc736c2723b..057a52431b00 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h +++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h | |||
@@ -530,12 +530,8 @@ | |||
530 | SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val) | 530 | SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val) |
531 | 531 | ||
532 | #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ | 532 | #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ |
533 | do { \ | 533 | memset((void *)__pdesc, 0, \ |
534 | if (_size > TX_DESC_NEXT_DESC_OFFSET) \ | 534 | min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET)) |
535 | memset((void *)__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \ | ||
536 | else \ | ||
537 | memset((void *)__pdesc, 0, _size); \ | ||
538 | } while (0); | ||
539 | 535 | ||
540 | /* For 92D early mode */ | 536 | /* For 92D early mode */ |
541 | #define SET_EARLYMODE_PKTNUM(__paddr, __value) \ | 537 | #define SET_EARLYMODE_PKTNUM(__paddr, __value) \ |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h index d1b0a1e14971..20afec62ce05 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h +++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h | |||
@@ -252,12 +252,7 @@ | |||
252 | * the desc is cleared. */ | 252 | * the desc is cleared. */ |
253 | #define TX_DESC_NEXT_DESC_OFFSET 36 | 253 | #define TX_DESC_NEXT_DESC_OFFSET 36 |
254 | #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ | 254 | #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \ |
255 | do { \ | 255 | memset(__pdesc, 0, min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET)) |
256 | if (_size > TX_DESC_NEXT_DESC_OFFSET) \ | ||
257 | memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \ | ||
258 | else \ | ||
259 | memset(__pdesc, 0, _size); \ | ||
260 | } while (0); | ||
261 | 256 | ||
262 | /* Rx Desc */ | 257 | /* Rx Desc */ |
263 | #define RX_STATUS_DESC_SIZE 24 | 258 | #define RX_STATUS_DESC_SIZE 24 |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h index b4afff626437..d53f4332464d 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h +++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h | |||
@@ -345,7 +345,7 @@ enum fw_h2c_cmd { | |||
345 | do { \ | 345 | do { \ |
346 | udelay(1000); \ | 346 | udelay(1000); \ |
347 | rtlpriv->rtlhal.fwcmd_iomap &= (~_Bit); \ | 347 | rtlpriv->rtlhal.fwcmd_iomap &= (~_Bit); \ |
348 | } while (0); | 348 | } while (0) |
349 | 349 | ||
350 | #define FW_CMD_IO_UPDATE(rtlpriv, _val) \ | 350 | #define FW_CMD_IO_UPDATE(rtlpriv, _val) \ |
351 | rtlpriv->rtlhal.fwcmd_iomap = _val; | 351 | rtlpriv->rtlhal.fwcmd_iomap = _val; |
@@ -354,13 +354,13 @@ enum fw_h2c_cmd { | |||
354 | do { \ | 354 | do { \ |
355 | rtl_write_word(rtlpriv, LBUS_MON_ADDR, (u16)_val); \ | 355 | rtl_write_word(rtlpriv, LBUS_MON_ADDR, (u16)_val); \ |
356 | FW_CMD_IO_UPDATE(rtlpriv, _val); \ | 356 | FW_CMD_IO_UPDATE(rtlpriv, _val); \ |
357 | } while (0); | 357 | } while (0) |
358 | 358 | ||
359 | #define FW_CMD_PARA_SET(rtlpriv, _val) \ | 359 | #define FW_CMD_PARA_SET(rtlpriv, _val) \ |
360 | do { \ | 360 | do { \ |
361 | rtl_write_dword(rtlpriv, LBUS_ADDR_MASK, _val); \ | 361 | rtl_write_dword(rtlpriv, LBUS_ADDR_MASK, _val); \ |
362 | rtlpriv->rtlhal.fwcmd_ioparam = _val; \ | 362 | rtlpriv->rtlhal.fwcmd_ioparam = _val; \ |
363 | } while (0); | 363 | } while (0) |
364 | 364 | ||
365 | #define FW_CMD_IO_QUERY(rtlpriv) \ | 365 | #define FW_CMD_IO_QUERY(rtlpriv) \ |
366 | (u16)(rtlpriv->rtlhal.fwcmd_iomap) | 366 | (u16)(rtlpriv->rtlhal.fwcmd_iomap) |