Commit 510c8f18 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Remove loops with constant MAX_RX_QUEUE

parent ac32633f
Loading
Loading
Loading
Loading
+58 −62
Original line number Diff line number Diff line
@@ -1141,10 +1141,9 @@ void rtl92e_tx_enable(struct net_device *dev)
static void _rtl92e_free_rx_ring(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	int i, rx_queue_idx;
	int i;
	int rx_queue_idx = 0;

	for (rx_queue_idx = 0; rx_queue_idx < MAX_RX_QUEUE;
	     rx_queue_idx++) {
	for (i = 0; i < priv->rxringcount; i++) {
		struct sk_buff *skb = priv->rx_buf[rx_queue_idx][i];

@@ -1163,7 +1162,6 @@ static void _rtl92e_free_rx_ring(struct net_device *dev)
			  priv->rx_ring_dma[rx_queue_idx]);
	priv->rx_ring[rx_queue_idx] = NULL;
}
}

static void _rtl92e_free_tx_ring(struct net_device *dev, unsigned int prio)
{
@@ -1353,9 +1351,9 @@ static short _rtl92e_alloc_rx_ring(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	struct rx_desc *entry = NULL;
	int i, rx_queue_idx;
	int i;
	int rx_queue_idx = 0;

	for (rx_queue_idx = 0; rx_queue_idx < MAX_RX_QUEUE; rx_queue_idx++) {
	priv->rx_ring[rx_queue_idx] = dma_alloc_coherent(&priv->pdev->dev,
							 sizeof(*priv->rx_ring[rx_queue_idx]) * priv->rxringcount,
							 &priv->rx_ring_dma[rx_queue_idx],
@@ -1393,7 +1391,6 @@ static short _rtl92e_alloc_rx_ring(struct net_device *dev)

	if (entry)
		entry->EOR = 1;
	}
	return 0;
}

@@ -1455,10 +1452,10 @@ static short _rtl92e_pci_initdescring(struct net_device *dev)
void rtl92e_reset_desc_ring(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	int i, rx_queue_idx;
	int i;
	int rx_queue_idx = 0;
	unsigned long flags = 0;

	for (rx_queue_idx = 0; rx_queue_idx < MAX_RX_QUEUE; rx_queue_idx++) {
	if (priv->rx_ring[rx_queue_idx]) {
		struct rx_desc *entry = NULL;

@@ -1468,7 +1465,6 @@ void rtl92e_reset_desc_ring(struct net_device *dev)
		}
		priv->rx_idx[rx_queue_idx] = 0;
	}
	}

	spin_lock_irqsave(&priv->irq_th_lock, flags);
	for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) {