ramips: don't read RAMIPS_RX_CALC_IDX0 register in the loop
authorGabor Juhos <juhosg@openwrt.org>
Sun, 26 Feb 2012 10:54:13 +0000 (10:54 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 26 Feb 2012 10:54:13 +0000 (10:54 +0000)
SVN-Revision: 30733

target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_main.c

index 60001e3bc111e2de9e73f5b3901900f70d4eedfd..beceb9441ea3ecb51baca8bfa7be3db96cc3c8c5 100644 (file)
@@ -717,13 +717,15 @@ ramips_eth_rx_hw(unsigned long ptr)
        int rx;
        int max_rx = 16;
 
+       rx = ramips_fe_rr(RAMIPS_RX_CALC_IDX0);
+
        while (max_rx) {
                struct raeth_rx_info *rxi;
                struct ramips_rx_dma *rxd;
                struct sk_buff *rx_skb, *new_skb;
                int pktlen;
 
-               rx = (ramips_fe_rr(RAMIPS_RX_CALC_IDX0) + 1) % NUM_RX_DESC;
+               rx = (rx + 1) % NUM_RX_DESC;
 
                rxi = &re->rx_info[rx];
                rxd = rxi->rx_desc;