From c5fe41c339180dea243443391d08f620fbf147c3 Mon Sep 17 00:00:00 2001 From: Jason Cooper Date: Tue, 14 Sep 2010 09:45:40 -0400 Subject: [PATCH] staging: brcm80211: fix "ERROR: Macros w/ mult. statements ... do - while loop" Signed-off-by: Jason Cooper Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/include/d11.h | 5 ++++- drivers/staging/brcm80211/util/hnddma.c | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/staging/brcm80211/include/d11.h b/drivers/staging/brcm80211/include/d11.h index 378832cfffe4..3dbd54c0cc74 100644 --- a/drivers/staging/brcm80211/include/d11.h +++ b/drivers/staging/brcm80211/include/d11.h @@ -696,7 +696,10 @@ BWL_PRE_PACKED_STRUCT struct cck_phy_hdr { #define WLC_GET_CCK_PLCP_LEN(plcp) (plcp[4] + (plcp[5] << 8)) #define WLC_GET_MIMO_PLCP_LEN(plcp) (plcp[1] + (plcp[2] << 8)) #define WLC_SET_MIMO_PLCP_LEN(plcp, len) \ - plcp[1] = len & 0xff; plcp[2] = ((len >> 8) & 0xff); + do { \ + plcp[1] = len & 0xff; \ + plcp[2] = ((len >> 8) & 0xff); \ + } while (0); #define WLC_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU) #define WLC_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU) diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c index 7c2ed272d0a7..95f6f4143ff2 100644 --- a/drivers/staging/brcm80211/util/hnddma.c +++ b/drivers/staging/brcm80211/util/hnddma.c @@ -28,8 +28,20 @@ /* debug/trace */ #ifdef BCMDBG -#define DMA_ERROR(args) if (!(*di->msg_level & 1)); else printf args -#define DMA_TRACE(args) if (!(*di->msg_level & 2)); else printf args +#define DMA_ERROR(args) \ + do { \ + if (!(*di->msg_level & 1)) \ + ; \ + else \ + printf args; \ + } while (0) +#define DMA_TRACE(args) \ + do { \ + if (!(*di->msg_level & 2)) \ + ; \ + else \ + printf args; \ + } while (0) #else #define DMA_ERROR(args) #define DMA_TRACE(args) -- 2.20.1