Commit c03b63c1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: brcm80211: util: remove unneeded usage of uintptr


Double casting is pretty pointless, don't do that.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f1d0fe0a
...@@ -705,23 +705,23 @@ static void _dma_detach(dma_info_t *di) ...@@ -705,23 +705,23 @@ static void _dma_detach(dma_info_t *di)
if (DMA64_ENAB(di) && DMA64_MODE(di)) { if (DMA64_ENAB(di) && DMA64_MODE(di)) {
if (di->txd64) if (di->txd64)
DMA_FREE_CONSISTENT(di->osh, DMA_FREE_CONSISTENT(di->osh,
((s8 *) (uintptr) di->txd64 - ((s8 *)di->txd64 -
di->txdalign), di->txdalloc, di->txdalign), di->txdalloc,
(di->txdpaorig), &di->tx_dmah); (di->txdpaorig), &di->tx_dmah);
if (di->rxd64) if (di->rxd64)
DMA_FREE_CONSISTENT(di->osh, DMA_FREE_CONSISTENT(di->osh,
((s8 *) (uintptr) di->rxd64 - ((s8 *)di->rxd64 -
di->rxdalign), di->rxdalloc, di->rxdalign), di->rxdalloc,
(di->rxdpaorig), &di->rx_dmah); (di->rxdpaorig), &di->rx_dmah);
} else if (DMA32_ENAB(di)) { } else if (DMA32_ENAB(di)) {
if (di->txd32) if (di->txd32)
DMA_FREE_CONSISTENT(di->osh, DMA_FREE_CONSISTENT(di->osh,
((s8 *) (uintptr) di->txd32 - ((s8 *)di->txd32 -
di->txdalign), di->txdalloc, di->txdalign), di->txdalloc,
(di->txdpaorig), &di->tx_dmah); (di->txdpaorig), &di->tx_dmah);
if (di->rxd32) if (di->rxd32)
DMA_FREE_CONSISTENT(di->osh, DMA_FREE_CONSISTENT(di->osh,
((s8 *) (uintptr) di->rxd32 - ((s8 *)di->rxd32 -
di->rxdalign), di->rxdalloc, di->rxdalign), di->rxdalloc,
(di->rxdpaorig), &di->rx_dmah); (di->rxdpaorig), &di->rx_dmah);
} else } else
...@@ -912,7 +912,7 @@ static void _dma_rxinit(dma_info_t *di) ...@@ -912,7 +912,7 @@ static void _dma_rxinit(dma_info_t *di)
/* clear rx descriptor ring */ /* clear rx descriptor ring */
if (DMA64_ENAB(di) && DMA64_MODE(di)) { if (DMA64_ENAB(di) && DMA64_MODE(di)) {
BZERO_SM((void *)(uintptr) di->rxd64, BZERO_SM((void *)di->rxd64,
(di->nrxd * sizeof(dma64dd_t))); (di->nrxd * sizeof(dma64dd_t)));
/* DMA engine with out alignment requirement requires table to be inited /* DMA engine with out alignment requirement requires table to be inited
...@@ -926,7 +926,7 @@ static void _dma_rxinit(dma_info_t *di) ...@@ -926,7 +926,7 @@ static void _dma_rxinit(dma_info_t *di)
if (di->aligndesc_4k) if (di->aligndesc_4k)
_dma_ddtable_init(di, DMA_RX, di->rxdpa); _dma_ddtable_init(di, DMA_RX, di->rxdpa);
} else if (DMA32_ENAB(di)) { } else if (DMA32_ENAB(di)) {
BZERO_SM((void *)(uintptr) di->rxd32, BZERO_SM((void *)di->rxd32,
(di->nrxd * sizeof(dma32dd_t))); (di->nrxd * sizeof(dma32dd_t)));
_dma_rxenable(di); _dma_rxenable(di);
_dma_ddtable_init(di, DMA_RX, di->rxdpa); _dma_ddtable_init(di, DMA_RX, di->rxdpa);
...@@ -1444,7 +1444,7 @@ static void dma32_txinit(dma_info_t *di) ...@@ -1444,7 +1444,7 @@ static void dma32_txinit(dma_info_t *di)
di->hnddma.txavail = di->ntxd - 1; di->hnddma.txavail = di->ntxd - 1;
/* clear tx descriptor ring */ /* clear tx descriptor ring */
BZERO_SM((void *)(uintptr) di->txd32, (di->ntxd * sizeof(dma32dd_t))); BZERO_SM((void *)di->txd32, (di->ntxd * sizeof(dma32dd_t)));
if ((di->hnddma.dmactrlflags & DMA_CTRL_PEN) == 0) if ((di->hnddma.dmactrlflags & DMA_CTRL_PEN) == 0)
control |= XC_PD; control |= XC_PD;
...@@ -1545,7 +1545,7 @@ static bool dma32_alloc(dma_info_t *di, uint direction) ...@@ -1545,7 +1545,7 @@ static bool dma32_alloc(dma_info_t *di, uint direction)
ASSERT(PHYSADDRHI(di->txdpaorig) == 0); ASSERT(PHYSADDRHI(di->txdpaorig) == 0);
di->txd32 = (dma32dd_t *) ROUNDUP((uintptr) va, align); di->txd32 = (dma32dd_t *) ROUNDUP((uintptr) va, align);
di->txdalign = di->txdalign =
(uint) ((s8 *) (uintptr) di->txd32 - (s8 *) va); (uint) ((s8 *)di->txd32 - (s8 *) va);
PHYSADDRLOSET(di->txdpa, PHYSADDRLOSET(di->txdpa,
PHYSADDRLO(di->txdpaorig) + di->txdalign); PHYSADDRLO(di->txdpaorig) + di->txdalign);
...@@ -1566,7 +1566,7 @@ static bool dma32_alloc(dma_info_t *di, uint direction) ...@@ -1566,7 +1566,7 @@ static bool dma32_alloc(dma_info_t *di, uint direction)
ASSERT(PHYSADDRHI(di->rxdpaorig) == 0); ASSERT(PHYSADDRHI(di->rxdpaorig) == 0);
di->rxd32 = (dma32dd_t *) ROUNDUP((uintptr) va, align); di->rxd32 = (dma32dd_t *) ROUNDUP((uintptr) va, align);
di->rxdalign = di->rxdalign =
(uint) ((s8 *) (uintptr) di->rxd32 - (s8 *) va); (uint) ((s8 *)di->rxd32 - (s8 *) va);
PHYSADDRLOSET(di->rxdpa, PHYSADDRLOSET(di->rxdpa,
PHYSADDRLO(di->rxdpaorig) + di->rxdalign); PHYSADDRLO(di->rxdpaorig) + di->rxdalign);
...@@ -1999,7 +1999,7 @@ static void dma64_txinit(dma_info_t *di) ...@@ -1999,7 +1999,7 @@ static void dma64_txinit(dma_info_t *di)
di->hnddma.txavail = di->ntxd - 1; di->hnddma.txavail = di->ntxd - 1;
/* clear tx descriptor ring */ /* clear tx descriptor ring */
BZERO_SM((void *)(uintptr) di->txd64, (di->ntxd * sizeof(dma64dd_t))); BZERO_SM((void *)di->txd64, (di->ntxd * sizeof(dma64dd_t)));
/* DMA engine with out alignment requirement requires table to be inited /* DMA engine with out alignment requirement requires table to be inited
* before enabling the engine * before enabling the engine
...@@ -2110,8 +2110,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction) ...@@ -2110,8 +2110,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
} }
align = (1 << align_bits); align = (1 << align_bits);
di->txd64 = (dma64dd_t *) ROUNDUP((uintptr) va, align); di->txd64 = (dma64dd_t *) ROUNDUP((uintptr) va, align);
di->txdalign = di->txdalign = (uint) ((s8 *)di->txd64 - (s8 *) va);
(uint) ((s8 *) (uintptr) di->txd64 - (s8 *) va);
PHYSADDRLOSET(di->txdpa, PHYSADDRLOSET(di->txdpa,
PHYSADDRLO(di->txdpaorig) + di->txdalign); PHYSADDRLO(di->txdpaorig) + di->txdalign);
/* Make sure that alignment didn't overflow */ /* Make sure that alignment didn't overflow */
...@@ -2129,8 +2128,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction) ...@@ -2129,8 +2128,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
} }
align = (1 << align_bits); align = (1 << align_bits);
di->rxd64 = (dma64dd_t *) ROUNDUP((uintptr) va, align); di->rxd64 = (dma64dd_t *) ROUNDUP((uintptr) va, align);
di->rxdalign = di->rxdalign = (uint) ((s8 *)di->rxd64 - (s8 *) va);
(uint) ((s8 *) (uintptr) di->rxd64 - (s8 *) va);
PHYSADDRLOSET(di->rxdpa, PHYSADDRLOSET(di->rxdpa,
PHYSADDRLO(di->rxdpaorig) + di->rxdalign); PHYSADDRLO(di->rxdpaorig) + di->rxdalign);
/* Make sure that alignment didn't overflow */ /* Make sure that alignment didn't overflow */
......
...@@ -188,7 +188,7 @@ int nvram_getall(char *buf, int count) ...@@ -188,7 +188,7 @@ int nvram_getall(char *buf, int count)
int acc; int acc;
from = this->vars; from = this->vars;
lim = (char *)((uintptr) this->vars + this->size); lim = (char *)(this->vars + this->size);
to = buf; to = buf;
acc = 0; acc = 0;
while ((from < lim) && (*from)) { while ((from < lim) && (*from)) {
......
...@@ -350,7 +350,7 @@ static void *_sb_setcoreidx(si_info_t *sii, uint coreidx) ...@@ -350,7 +350,7 @@ static void *_sb_setcoreidx(si_info_t *sii, uint coreidx)
case SDIO_BUS: case SDIO_BUS:
/* map new one */ /* map new one */
if (!sii->regs[coreidx]) { if (!sii->regs[coreidx]) {
sii->regs[coreidx] = (void *)(uintptr) sbaddr; sii->regs[coreidx] = (void *)sbaddr;
ASSERT(GOODREGS(sii->regs[coreidx])); ASSERT(GOODREGS(sii->regs[coreidx]));
} }
regs = sii->regs[coreidx]; regs = sii->regs[coreidx];
......
...@@ -173,7 +173,7 @@ BCMATTACHFN(si_buscore_setup) (si_info_t *sii, chipcregs_t *cc, uint bustype, ...@@ -173,7 +173,7 @@ BCMATTACHFN(si_buscore_setup) (si_info_t *sii, chipcregs_t *cc, uint bustype,
uint pciidx, pcieidx, pcirev, pcierev; uint pciidx, pcieidx, pcirev, pcierev;
cc = si_setcoreidx(&sii->pub, SI_CC_IDX); cc = si_setcoreidx(&sii->pub, SI_CC_IDX);
ASSERT((uintptr) cc); ASSERT(cc);
/* get chipcommon rev */ /* get chipcommon rev */
sii->pub.ccrev = (int)si_corerev(&sii->pub); sii->pub.ccrev = (int)si_corerev(&sii->pub);
...@@ -286,7 +286,7 @@ BCMATTACHFN(si_buscore_setup) (si_info_t *sii, chipcregs_t *cc, uint bustype, ...@@ -286,7 +286,7 @@ BCMATTACHFN(si_buscore_setup) (si_info_t *sii, chipcregs_t *cc, uint bustype,
if (BUSTYPE(sii->pub.bustype) == PCI_BUS) { if (BUSTYPE(sii->pub.bustype) == PCI_BUS) {
if (SI_FAST(sii)) { if (SI_FAST(sii)) {
if (!sii->pch) { if (!sii->pch) {
sii->pch = (void *)(uintptr)pcicore_init( sii->pch = (void *)pcicore_init(
&sii->pub, sii->osh, &sii->pub, sii->osh,
(void *)PCIEREGS(sii)); (void *)PCIEREGS(sii));
if (sii->pch == NULL) if (sii->pch == NULL)
...@@ -574,7 +574,7 @@ static si_info_t *BCMATTACHFN(si_doattach) (si_info_t *sii, uint devid, ...@@ -574,7 +574,7 @@ static si_info_t *BCMATTACHFN(si_doattach) (si_info_t *sii, uint devid,
if (CHIPTYPE(sii->pub.socitype) == SOCI_AI) { if (CHIPTYPE(sii->pub.socitype) == SOCI_AI) {
SI_MSG(("Found chip type AI (0x%08x)\n", w)); SI_MSG(("Found chip type AI (0x%08x)\n", w));
/* pass chipc address instead of original core base */ /* pass chipc address instead of original core base */
ai_scan(&sii->pub, (void *)(uintptr) cc, devid); ai_scan(&sii->pub, (void *)cc, devid);
} else { } else {
SI_ERROR(("Found chip of unknown type (0x%08x)\n", w)); SI_ERROR(("Found chip of unknown type (0x%08x)\n", w));
return NULL; return NULL;
...@@ -1203,7 +1203,7 @@ void BCMINITFN(si_clkctl_init) (si_t *sih) ...@@ -1203,7 +1203,7 @@ void BCMINITFN(si_clkctl_init) (si_t *sih)
SET_REG(sii->osh, &cc->system_clk_ctl, SYCC_CD_MASK, SET_REG(sii->osh, &cc->system_clk_ctl, SYCC_CD_MASK,
(ILP_DIV_1MHZ << SYCC_CD_SHIFT)); (ILP_DIV_1MHZ << SYCC_CD_SHIFT));
si_clkctl_setdelay(sii, (void *)(uintptr) cc); si_clkctl_setdelay(sii, (void *)cc);
if (!fast) if (!fast)
si_setcoreidx(sih, origidx); si_setcoreidx(sih, origidx);
......
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