Commit 34ddb207 authored by Mike McCormack's avatar Mike McCormack Committed by John W. Linville

rtlwifi: Store loop index in local variable

_rtl_pci_rx_interrupt uses rtlpci->rx_ring[rx_queue_idx].idx a
few times, so store it in a separate variable.
Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f2ea312c
...@@ -644,22 +644,23 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -644,22 +644,23 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
.noise = -98, .noise = -98,
.rate = 0, .rate = 0,
}; };
int index = rtlpci->rx_ring[rx_queue_idx].idx;
/*RX NORMAL PKT */ /*RX NORMAL PKT */
while (count--) { while (count--) {
/*rx descriptor */ /*rx descriptor */
struct rtl_rx_desc *pdesc = &rtlpci->rx_ring[rx_queue_idx].desc[ struct rtl_rx_desc *pdesc = &rtlpci->rx_ring[rx_queue_idx].desc[
rtlpci->rx_ring[rx_queue_idx].idx]; index];
/*rx pkt */ /*rx pkt */
struct sk_buff *skb = rtlpci->rx_ring[rx_queue_idx].rx_buf[ struct sk_buff *skb = rtlpci->rx_ring[rx_queue_idx].rx_buf[
rtlpci->rx_ring[rx_queue_idx].idx]; index];
own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc,
false, HW_DESC_OWN); false, HW_DESC_OWN);
if (own) { if (own) {
/*wait data to be filled by hardware */ /*wait data to be filled by hardware */
return; break;
} else { } else {
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
__le16 fc; __le16 fc;
...@@ -770,10 +771,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -770,10 +771,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
skb = new_skb; skb = new_skb;
rtlpci->rx_ring[rx_queue_idx].rx_buf[rtlpci-> rtlpci->rx_ring[rx_queue_idx].rx_buf[index] = skb;
rx_ring
[rx_queue_idx].
idx] = skb;
*((dma_addr_t *) skb->cb) = *((dma_addr_t *) skb->cb) =
pci_map_single(rtlpci->pdev, skb_tail_pointer(skb), pci_map_single(rtlpci->pdev, skb_tail_pointer(skb),
rtlpci->rxbuffersize, rtlpci->rxbuffersize,
...@@ -792,17 +790,15 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -792,17 +790,15 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
HW_DESC_RXPKT_LEN, HW_DESC_RXPKT_LEN,
(u8 *)&rtlpci->rxbuffersize); (u8 *)&rtlpci->rxbuffersize);
if (rtlpci->rx_ring[rx_queue_idx].idx == if (index == rtlpci->rxringcount - 1)
rtlpci->rxringcount - 1)
rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false,
HW_DESC_RXERO, HW_DESC_RXERO,
(u8 *)&tmp_one); (u8 *)&tmp_one);
rtlpci->rx_ring[rx_queue_idx].idx = index = (index + 1) % rtlpci->rxringcount;
(rtlpci->rx_ring[rx_queue_idx].idx + 1) %
rtlpci->rxringcount;
} }
rtlpci->rx_ring[rx_queue_idx].idx = index;
} }
static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
......
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