staging: brcm80211: cleanup after R_REG/W_REG patches
authorRoland Vossen <rvossen@broadcom.com>
Wed, 1 Jun 2011 11:45:57 +0000 (13:45 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Jun 2011 19:43:30 +0000 (12:43 -0700)
Code cleanup. Removed unused sections. Added () to make macro safe.

Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmsmac/wlc_types.h
drivers/staging/brcm80211/include/brcmu_utils.h

index acf2a55d1a0f1fe0b518f023717a5bf0ad6c0a5a..75bf17b48c2db310e594762552e6dc2ab959dc8c 100644 (file)
 
 #include <bcmsoc.h>
 
-/* register access macros */
-#if defined(BCMSDIO)
-#ifdef BRCM_FULLMAC
-#include <bcmsdh.h>
-#endif
-#endif
-
 /* register access macros */
 #ifndef __BIG_ENDIAN
 #ifndef __mips__
 #define R_REG(r) \
-       bcmsdh_reg_read(NULL, (unsigned long)r, sizeof(*r))
+       bcmsdh_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
 #else                          /* __mips__ */
 #define R_REG(r) \
        ({ \
                __typeof(*(r)) __osl_v; \
                __asm__ __volatile__("sync"); \
-               __osl_v = bcmsdh_reg_read(NULL, (unsigned long)r, sizeof(*r)); \
+               __osl_v = bcmsdh_reg_read(NULL, (unsigned long)(r),\
+                                         sizeof(*(r))); \
                __asm__ __volatile__("sync"); \
                __osl_v; \
        })
 #endif                         /* __mips__ */
 
 #define W_REG(r, v) do { \
-               bcmsdh_reg_write(NULL, (unsigned long)r, sizeof(*r), (v)); \
+               bcmsdh_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), (v)); \
        } while (0)
 #else                          /* __BIG_ENDIAN */
 #define R_REG(r) \
-       bcmsdh_reg_read(NULL, (unsigned long)r, sizeof(*r))
+       bcmsdh_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
 #define W_REG(r, v) do { \
-               bcmsdh_reg_write(NULL, (unsigned long)r, sizeof(*r), v); \
+               bcmsdh_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), (v)); \
        } while (0)
 #endif                         /* __BIG_ENDIAN */
 
-#ifdef __mips__
-/*
- * bcm4716 (which includes 4717 & 4718), plus 4706 on PCIe can reorder
- * transactions. As a fix, a read after write is performed on certain places
- * in the code. Older chips and the newer 5357 family don't require this fix.
- */
-#define W_REG_FLUSH(r, v)      ({ W_REG((r), (v)); (void)R_REG(r); })
-#else
-#define W_REG_FLUSH(r, v)      W_REG((r), (v))
-#endif                         /* __mips__ */
-
 #define AND_REG(r, v)  W_REG((r), R_REG(r) & (v))
 #define OR_REG(r, v)   W_REG((r), R_REG(r) | (v))
 
index 059dc17b429d5a9292231eee00919a440d9cdc19..db296d425c053683831d6aeaf6f1377b1b6dbdf2 100644 (file)
@@ -41,13 +41,6 @@ do {                                         \
 
 #define WL_ERROR_ON()          (brcm_msg_level & LOG_ERROR_VAL)
 
-/* register access macros */
-#if defined(BCMSDIO)
-#ifdef BRCM_FULLMAC
-#include <bcmsdh.h>
-#endif
-#endif
-
 /* register access macros */
 #ifndef __BIG_ENDIAN
 #ifndef __mips__
index 94ae60493fe58b649b4865e7f8dcf32147988153..e4007d4f43e4a08bc52883c3234abe4e3476e61e 100644 (file)
@@ -239,10 +239,6 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
 #define        PKTBUFSZ        2048
 
 #define OSL_SYSUPTIME()                ((u32)jiffies * (1000 / HZ))
-#ifdef BRCM_FULLMAC
-#include <linux/kernel.h>      /* for vsn/printf's */
-#include <linux/string.h>      /* for mem*, str* */
-#endif
 
 #ifndef setbit
 #ifndef NBBY                   /* the BSD family defines NBBY */