Staging: brcm80211: remove ISALIGNED macro
And use the kernel provided IS_ALIGNED one instead. Cc: Brett Rudley <brudley@broadcom.com> Cc: Henry Ptasinski <henryp@broadcom.com> Cc: Nohee Ko <noheek@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d2733c97fa
commit
36c63ff6af
@ -883,7 +883,7 @@ uint pktsetprio(void *pkt, bool update_vtag)
|
||||
int rc = 0;
|
||||
|
||||
pktdata = (u8 *) PKTDATA(pkt);
|
||||
ASSERT(ISALIGNED((uintptr) pktdata, sizeof(u16)));
|
||||
ASSERT(IS_ALIGNED((uintptr) pktdata, sizeof(u16)));
|
||||
|
||||
eh = (struct ether_header *)pktdata;
|
||||
|
||||
|
@ -1087,7 +1087,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, void *pkt)
|
||||
|
||||
/* Add space for the header */
|
||||
PKTPUSH(pkt, SDPCM_HDRLEN);
|
||||
ASSERT(ISALIGNED((uintptr) PKTDATA(pkt), 2));
|
||||
ASSERT(IS_ALIGNED((uintptr) PKTDATA(pkt), 2));
|
||||
|
||||
prec = PRIO2PREC((PKTPRIO(pkt) & PRIOMASK));
|
||||
|
||||
@ -1265,7 +1265,7 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
|
||||
if (forcealign && (len & (ALIGNMENT - 1)))
|
||||
len = ROUNDUP(len, ALIGNMENT);
|
||||
|
||||
ASSERT(ISALIGNED((uintptr) frame, 2));
|
||||
ASSERT(IS_ALIGNED((uintptr) frame, 2));
|
||||
|
||||
/* Need to lock here to protect txseq and SDIO tx calls */
|
||||
dhd_os_sdlock(bus->dhd);
|
||||
|
@ -451,7 +451,6 @@ extern "C" {
|
||||
|
||||
#define CEIL(x, y) (((x) + ((y)-1)) / (y))
|
||||
#define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y))
|
||||
#define ISALIGNED(a, x) (((a) & ((x)-1)) == 0)
|
||||
#define ISPOWEROF2(x) ((((x)-1)&(x)) == 0)
|
||||
#define VALID_MASK(mask) (!((mask) & ((mask) + 1)))
|
||||
|
||||
|
@ -268,8 +268,8 @@ typedef struct si_info {
|
||||
#define SI_INFO(sih) (si_info_t *)(uintptr)sih
|
||||
|
||||
#define GOODCOREADDR(x, b) (((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
|
||||
ISALIGNED((x), SI_CORE_SIZE))
|
||||
#define GOODREGS(regs) ((regs) != NULL && ISALIGNED((uintptr)(regs), SI_CORE_SIZE))
|
||||
IS_ALIGNED((x), SI_CORE_SIZE))
|
||||
#define GOODREGS(regs) ((regs) != NULL && IS_ALIGNED((uintptr)(regs), SI_CORE_SIZE))
|
||||
#define BADCOREADDR 0
|
||||
#define GOODIDX(idx) (((uint)idx) < SI_MAXCORES)
|
||||
#define NOREV -1 /* Invalid rev */
|
||||
|
@ -1789,8 +1789,8 @@ wlc_bmac_write_template_ram(wlc_hw_info_t *wlc_hw, int offset, int len,
|
||||
regs = wlc_hw->regs;
|
||||
osh = wlc_hw->osh;
|
||||
|
||||
ASSERT(ISALIGNED(offset, sizeof(u32)));
|
||||
ASSERT(ISALIGNED(len, sizeof(u32)));
|
||||
ASSERT(IS_ALIGNED(offset, sizeof(u32)));
|
||||
ASSERT(IS_ALIGNED(len, sizeof(u32)));
|
||||
ASSERT((offset & ~0xffff) == 0);
|
||||
|
||||
W_REG(osh, ®s->tplatewrptr, offset);
|
||||
@ -2824,7 +2824,7 @@ BCMATTACHFN(wlc_ucode_write) (wlc_hw_info_t *wlc_hw, const u32 ucode[],
|
||||
|
||||
WL_TRACE(("wl%d: wlc_ucode_write\n", wlc_hw->unit));
|
||||
|
||||
ASSERT(ISALIGNED(nbytes, sizeof(u32)));
|
||||
ASSERT(IS_ALIGNED(nbytes, sizeof(u32)));
|
||||
|
||||
count = (nbytes / sizeof(u32));
|
||||
|
||||
|
@ -1793,7 +1793,7 @@ void *BCMATTACHFN(wlc_attach) (void *wl, u16 vendor, u16 device,
|
||||
ASSERT(sizeof(ht_cap_ie_t) == HT_CAP_IE_LEN);
|
||||
ASSERT(offsetof(wl_scan_params_t, channel_list) ==
|
||||
WL_SCAN_PARAMS_FIXED_SIZE);
|
||||
ASSERT(ISALIGNED(offsetof(wsec_key_t, data), sizeof(u32)));
|
||||
ASSERT(IS_ALIGNED(offsetof(wsec_key_t, data), sizeof(u32)));
|
||||
ASSERT(ISPOWEROF2(MA_WINDOW_SZ));
|
||||
|
||||
ASSERT(sizeof(wlc_d11rxhdr_t) <= WL_HWRXOFF);
|
||||
@ -4619,7 +4619,7 @@ wlc_iovar_op(wlc_info_t *wlc, const char *name,
|
||||
ASSERT(!set || (!params && !p_len));
|
||||
|
||||
if (!set && (len == sizeof(int)) &&
|
||||
!(ISALIGNED((uintptr) (arg), (uint) sizeof(int)))) {
|
||||
!(IS_ALIGNED((uintptr) (arg), (uint) sizeof(int)))) {
|
||||
WL_ERROR(("wl%d: %s unaligned get ptr for %s\n",
|
||||
wlc->pub->unit, __func__, name));
|
||||
ASSERT(0);
|
||||
@ -6330,7 +6330,7 @@ wlc_d11hdrs_mac80211(wlc_info_t *wlc, struct ieee80211_hw *hw,
|
||||
}
|
||||
|
||||
/* RTS PLCP header */
|
||||
ASSERT(ISALIGNED((uintptr) txh->RTSPhyHeader, sizeof(u16)));
|
||||
ASSERT(IS_ALIGNED((uintptr) txh->RTSPhyHeader, sizeof(u16)));
|
||||
rts_plcp = txh->RTSPhyHeader;
|
||||
if (use_cts)
|
||||
rts_phylen = DOT11_CTS_LEN + DOT11_FCS_LEN;
|
||||
@ -7176,7 +7176,7 @@ wlc_recvctl(wlc_info_t *wlc, osl_t *osh, d11rxhdr_t *rxh, void *p)
|
||||
ASSERT(!PKTNEXT(p));
|
||||
ASSERT(!PKTLINK(p));
|
||||
|
||||
ASSERT(ISALIGNED((uintptr) skb->data, 2));
|
||||
ASSERT(IS_ALIGNED((uintptr) skb->data, 2));
|
||||
|
||||
memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
|
||||
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
|
||||
|
@ -1132,7 +1132,7 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di)
|
||||
pa = DMA_MAP(di->osh, PKTDATA(p),
|
||||
di->rxbufsize, DMA_RX, p, &di->rxp_dmah[rxout]);
|
||||
|
||||
ASSERT(ISALIGNED(PHYSADDRLO(pa), 4));
|
||||
ASSERT(IS_ALIGNED(PHYSADDRLO(pa), 4));
|
||||
|
||||
/* save the free packet pointer */
|
||||
ASSERT(di->rxp[rxout] == NULL);
|
||||
@ -1553,7 +1553,7 @@ static bool dma32_alloc(dma_info_t *di, uint direction)
|
||||
ASSERT(PHYSADDRLO(di->txdpa) >= PHYSADDRLO(di->txdpaorig));
|
||||
|
||||
di->txdalloc = alloced;
|
||||
ASSERT(ISALIGNED((uintptr) di->txd32, align));
|
||||
ASSERT(IS_ALIGNED((uintptr) di->txd32, align));
|
||||
} else {
|
||||
va = dma_ringalloc(di->osh, D32RINGALIGN, size, &align_bits,
|
||||
&alloced, &di->rxdpaorig, &di->rx_dmah);
|
||||
@ -1573,7 +1573,7 @@ static bool dma32_alloc(dma_info_t *di, uint direction)
|
||||
/* Make sure that alignment didn't overflow */
|
||||
ASSERT(PHYSADDRLO(di->rxdpa) >= PHYSADDRLO(di->rxdpaorig));
|
||||
di->rxdalloc = alloced;
|
||||
ASSERT(ISALIGNED((uintptr) di->rxd32, align));
|
||||
ASSERT(IS_ALIGNED((uintptr) di->rxd32, align));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -2118,7 +2118,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
|
||||
|
||||
PHYSADDRHISET(di->txdpa, PHYSADDRHI(di->txdpaorig));
|
||||
di->txdalloc = alloced;
|
||||
ASSERT(ISALIGNED((uintptr) di->txd64, align));
|
||||
ASSERT(IS_ALIGNED((uintptr) di->txd64, align));
|
||||
} else {
|
||||
va = dma_ringalloc(di->osh, D64RINGALIGN, size, &align_bits,
|
||||
&alloced, &di->rxdpaorig, &di->rx_dmah);
|
||||
@ -2136,7 +2136,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
|
||||
|
||||
PHYSADDRHISET(di->rxdpa, PHYSADDRHI(di->rxdpaorig));
|
||||
di->rxdalloc = alloced;
|
||||
ASSERT(ISALIGNED((uintptr) di->rxd64, align));
|
||||
ASSERT(IS_ALIGNED((uintptr) di->rxd64, align));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -528,7 +528,7 @@ void *osl_dma_alloc_consistent(osl_t *osh, uint size, u16 align_bits,
|
||||
u16 align = (1 << align_bits);
|
||||
ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
|
||||
|
||||
if (!ISALIGNED(DMA_CONSISTENT_ALIGN, align))
|
||||
if (!IS_ALIGNED(DMA_CONSISTENT_ALIGN, align))
|
||||
size += align;
|
||||
*alloced = size;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user