diff options
author | Mike McCormack <mikem@ring3k.org> | 2011-05-30 19:49:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-03 14:57:33 -0400 |
commit | 34ddb2077e5ced1a09a1dd2cbb82f807bfc5f88b (patch) | |
tree | daf4d9264a55f9b9d146fc4f7f8d904f7b33e537 /drivers/net/wireless/rtlwifi/pci.c | |
parent | f2ea312cf4338ae187212e41b3dce97a666e3912 (diff) |
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: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/pci.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 89100e7c553b..b44de0d0cc9c 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -644,22 +644,23 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
644 | .noise = -98, | 644 | .noise = -98, |
645 | .rate = 0, | 645 | .rate = 0, |
646 | }; | 646 | }; |
647 | int index = rtlpci->rx_ring[rx_queue_idx].idx; | ||
647 | 648 | ||
648 | /*RX NORMAL PKT */ | 649 | /*RX NORMAL PKT */ |
649 | while (count--) { | 650 | while (count--) { |
650 | /*rx descriptor */ | 651 | /*rx descriptor */ |
651 | struct rtl_rx_desc *pdesc = &rtlpci->rx_ring[rx_queue_idx].desc[ | 652 | struct rtl_rx_desc *pdesc = &rtlpci->rx_ring[rx_queue_idx].desc[ |
652 | rtlpci->rx_ring[rx_queue_idx].idx]; | 653 | index]; |
653 | /*rx pkt */ | 654 | /*rx pkt */ |
654 | struct sk_buff *skb = rtlpci->rx_ring[rx_queue_idx].rx_buf[ | 655 | struct sk_buff *skb = rtlpci->rx_ring[rx_queue_idx].rx_buf[ |
655 | rtlpci->rx_ring[rx_queue_idx].idx]; | 656 | index]; |
656 | 657 | ||
657 | own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, | 658 | own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) pdesc, |
658 | false, HW_DESC_OWN); | 659 | false, HW_DESC_OWN); |
659 | 660 | ||
660 | if (own) { | 661 | if (own) { |
661 | /*wait data to be filled by hardware */ | 662 | /*wait data to be filled by hardware */ |
662 | return; | 663 | break; |
663 | } else { | 664 | } else { |
664 | struct ieee80211_hdr *hdr; | 665 | struct ieee80211_hdr *hdr; |
665 | __le16 fc; | 666 | __le16 fc; |
@@ -770,10 +771,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
770 | 771 | ||
771 | skb = new_skb; | 772 | skb = new_skb; |
772 | 773 | ||
773 | rtlpci->rx_ring[rx_queue_idx].rx_buf[rtlpci-> | 774 | rtlpci->rx_ring[rx_queue_idx].rx_buf[index] = skb; |
774 | rx_ring | ||
775 | [rx_queue_idx]. | ||
776 | idx] = skb; | ||
777 | *((dma_addr_t *) skb->cb) = | 775 | *((dma_addr_t *) skb->cb) = |
778 | pci_map_single(rtlpci->pdev, skb_tail_pointer(skb), | 776 | pci_map_single(rtlpci->pdev, skb_tail_pointer(skb), |
779 | rtlpci->rxbuffersize, | 777 | rtlpci->rxbuffersize, |
@@ -792,17 +790,15 @@ done: | |||
792 | HW_DESC_RXPKT_LEN, | 790 | HW_DESC_RXPKT_LEN, |
793 | (u8 *)&rtlpci->rxbuffersize); | 791 | (u8 *)&rtlpci->rxbuffersize); |
794 | 792 | ||
795 | if (rtlpci->rx_ring[rx_queue_idx].idx == | 793 | if (index == rtlpci->rxringcount - 1) |
796 | rtlpci->rxringcount - 1) | ||
797 | rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, | 794 | rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, |
798 | HW_DESC_RXERO, | 795 | HW_DESC_RXERO, |
799 | (u8 *)&tmp_one); | 796 | (u8 *)&tmp_one); |
800 | 797 | ||
801 | rtlpci->rx_ring[rx_queue_idx].idx = | 798 | index = (index + 1) % rtlpci->rxringcount; |
802 | (rtlpci->rx_ring[rx_queue_idx].idx + 1) % | ||
803 | rtlpci->rxringcount; | ||
804 | } | 799 | } |
805 | 800 | ||
801 | rtlpci->rx_ring[rx_queue_idx].idx = index; | ||
806 | } | 802 | } |
807 | 803 | ||
808 | static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | 804 | static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) |