summaryrefslogtreecommitdiffstats
path: root/drivers/staging/et131x
diff options
context:
space:
mode:
authorZHAO Gang <gamerh2o@gmail.com>2013-12-09 19:38:26 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-10 23:12:13 -0800
commitf876f59e4515a94b277d01c6e61ef4cf0733af15 (patch)
tree00a541ac784a37a6df91227a9111b5fc39592a15 /drivers/staging/et131x
parentbad5d26f2222ec02e32c2cf71c2bd5b82528ebad (diff)
staging: et131x: reduce split lines in et131x_rx_dma_memory_free
Signed-off-by: ZHAO Gang <gamerh2o@gmail.com> Acked-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/et131x')
-rw-r--r--drivers/staging/et131x/et131x.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 92725483b11..5a4546553a3 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -2281,6 +2281,7 @@ static void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
u32 pktstat_ringsize;
struct rfd *rfd;
struct rx_ring *rx_ring;
+ struct fbr_lookup *fbr;
/* Setup some convenience pointers */
rx_ring = &adapter->rx_ring;
@@ -2299,34 +2300,35 @@ static void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
/* Free Free Buffer Rings */
for (id = 0; id < NUM_FBRS; id++) {
- if (!rx_ring->fbr[id]->ring_virtaddr)
+ fbr = rx_ring->fbr[id];
+
+ if (!fbr->ring_virtaddr)
continue;
/* First the packet memory */
for (index = 0;
- index < (rx_ring->fbr[id]->num_entries / FBR_CHUNKS);
+ index < fbr->num_entries / FBR_CHUNKS;
index++) {
- if (rx_ring->fbr[id]->mem_virtaddrs[index]) {
- bufsize =
- rx_ring->fbr[id]->buffsize * FBR_CHUNKS;
+ if (fbr->mem_virtaddrs[index]) {
+ bufsize = fbr->buffsize * FBR_CHUNKS;
dma_free_coherent(&adapter->pdev->dev,
- bufsize,
- rx_ring->fbr[id]->mem_virtaddrs[index],
- rx_ring->fbr[id]->mem_physaddrs[index]);
+ bufsize,
+ fbr->mem_virtaddrs[index],
+ fbr->mem_physaddrs[index]);
- rx_ring->fbr[id]->mem_virtaddrs[index] = NULL;
+ fbr->mem_virtaddrs[index] = NULL;
}
}
- bufsize =
- sizeof(struct fbr_desc) * rx_ring->fbr[id]->num_entries;
+ bufsize = sizeof(struct fbr_desc) * fbr->num_entries;
- dma_free_coherent(&adapter->pdev->dev, bufsize,
- rx_ring->fbr[id]->ring_virtaddr,
- rx_ring->fbr[id]->ring_physaddr);
+ dma_free_coherent(&adapter->pdev->dev,
+ bufsize,
+ fbr->ring_virtaddr,
+ fbr->ring_physaddr);
- rx_ring->fbr[id]->ring_virtaddr = NULL;
+ fbr->ring_virtaddr = NULL;
}
/* Free Packet Status Ring */