diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2014-02-25 14:30:33 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:33:22 -0500 |
commit | b6a8cf2cd8f1d17c850db0f591e3d349d417b40a (patch) | |
tree | ae42793a6dbec149eb30663bd62d91a5c5f4babe | |
parent | 6f6c195b95136e0b2972b3c5213f6cd876c4fa8f (diff) |
brcmfmac: Small cleanup of redundant code.
In time some of the code got redundant, without being noticed.
This patch does not change any functionality, just removes
redundant code.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 04f5e32cfb48..ac61419dc998 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -770,8 +770,6 @@ brcmf_sdio_kso_control(struct brcmf_sdio *bus, bool on) | |||
770 | return err; | 770 | return err; |
771 | } | 771 | } |
772 | 772 | ||
773 | #define PKT_AVAILABLE() (intstatus & I_HMB_FRAME_IND) | ||
774 | |||
775 | #define HOSTINTMASK (I_HMB_SW_MASK | I_CHIPACTIVE) | 773 | #define HOSTINTMASK (I_HMB_SW_MASK | I_CHIPACTIVE) |
776 | 774 | ||
777 | /* Turn backplane clock on or off */ | 775 | /* Turn backplane clock on or off */ |
@@ -870,7 +868,6 @@ static int brcmf_sdio_htclk(struct brcmf_sdio *bus, bool on, bool pendok) | |||
870 | } | 868 | } |
871 | #endif /* defined (DEBUG) */ | 869 | #endif /* defined (DEBUG) */ |
872 | 870 | ||
873 | bus->activity = true; | ||
874 | } else { | 871 | } else { |
875 | clkreq = 0; | 872 | clkreq = 0; |
876 | 873 | ||
@@ -2341,7 +2338,7 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) | |||
2341 | cnt += i; | 2338 | cnt += i; |
2342 | 2339 | ||
2343 | /* In poll mode, need to check for other events */ | 2340 | /* In poll mode, need to check for other events */ |
2344 | if (!bus->intr && cnt) { | 2341 | if (!bus->intr) { |
2345 | /* Check device status, signal pending interrupt */ | 2342 | /* Check device status, signal pending interrupt */ |
2346 | sdio_claim_host(bus->sdiodev->func[1]); | 2343 | sdio_claim_host(bus->sdiodev->func[1]); |
2347 | ret = r_sdreg32(bus, &intstatus, | 2344 | ret = r_sdreg32(bus, &intstatus, |
@@ -2485,9 +2482,8 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) | |||
2485 | { | 2482 | { |
2486 | u32 newstatus = 0; | 2483 | u32 newstatus = 0; |
2487 | unsigned long intstatus; | 2484 | unsigned long intstatus; |
2488 | uint rxlimit = bus->rxbound; /* Rx frames to read before resched */ | ||
2489 | uint txlimit = bus->txbound; /* Tx frames to send before resched */ | 2485 | uint txlimit = bus->txbound; /* Tx frames to send before resched */ |
2490 | uint framecnt = 0; /* Temporary counter of tx/rx frames */ | 2486 | uint framecnt; /* Temporary counter of tx/rx frames */ |
2491 | int err = 0, n; | 2487 | int err = 0, n; |
2492 | 2488 | ||
2493 | brcmf_dbg(TRACE, "Enter\n"); | 2489 | brcmf_dbg(TRACE, "Enter\n"); |
@@ -2585,11 +2581,10 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) | |||
2585 | intstatus &= ~I_HMB_FRAME_IND; | 2581 | intstatus &= ~I_HMB_FRAME_IND; |
2586 | 2582 | ||
2587 | /* On frame indication, read available frames */ | 2583 | /* On frame indication, read available frames */ |
2588 | if (PKT_AVAILABLE() && bus->clkstate == CLK_AVAIL) { | 2584 | if ((intstatus & I_HMB_FRAME_IND) && (bus->clkstate == CLK_AVAIL)) { |
2589 | framecnt = brcmf_sdio_readframes(bus, rxlimit); | 2585 | brcmf_sdio_readframes(bus, bus->rxbound); |
2590 | if (!bus->rxpending) | 2586 | if (!bus->rxpending) |
2591 | intstatus &= ~I_HMB_FRAME_IND; | 2587 | intstatus &= ~I_HMB_FRAME_IND; |
2592 | rxlimit -= min(framecnt, rxlimit); | ||
2593 | } | 2588 | } |
2594 | 2589 | ||
2595 | /* Keep still-pending events for next scheduling */ | 2590 | /* Keep still-pending events for next scheduling */ |
@@ -2647,8 +2642,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) | |||
2647 | && data_ok(bus)) { | 2642 | && data_ok(bus)) { |
2648 | framecnt = bus->rxpending ? min(txlimit, bus->txminmax) : | 2643 | framecnt = bus->rxpending ? min(txlimit, bus->txminmax) : |
2649 | txlimit; | 2644 | txlimit; |
2650 | framecnt = brcmf_sdio_sendfromq(bus, framecnt); | 2645 | brcmf_sdio_sendfromq(bus, framecnt); |
2651 | txlimit -= framecnt; | ||
2652 | } | 2646 | } |
2653 | 2647 | ||
2654 | if (!brcmf_bus_ready(bus->sdiodev->bus_if) || (err != 0)) { | 2648 | if (!brcmf_bus_ready(bus->sdiodev->bus_if) || (err != 0)) { |
@@ -2658,7 +2652,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) | |||
2658 | atomic_read(&bus->ipend) > 0 || | 2652 | atomic_read(&bus->ipend) > 0 || |
2659 | (!atomic_read(&bus->fcstate) && | 2653 | (!atomic_read(&bus->fcstate) && |
2660 | brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && | 2654 | brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && |
2661 | data_ok(bus)) || PKT_AVAILABLE()) { | 2655 | data_ok(bus))) { |
2662 | atomic_inc(&bus->dpc_tskcnt); | 2656 | atomic_inc(&bus->dpc_tskcnt); |
2663 | } | 2657 | } |
2664 | } | 2658 | } |