Peter Korsgaard said the following on 2007-12-3 21:47:
>>>>>> "Wang" == Wang Chen <[EMAIL PROTECTED]> writes:
> 
> Hi,
> 
>  Wang> +      len = skb->len;
>  Wang>        netif_rx(skb);
>  dev-> stats.rx_packets++;
>  Wang> -      dev->stats.rx_bytes += skb->len;
>  Wang> +      dev->stats.rx_bytes += len;
> 
> Why not simply update the stats before calling netif_rx as the return
> value isn't checked anyway?
> 

Even the return value of netif_rx isn't checked, dev->stats maybe
changed in netif_rx. But fortunately dev->stats isn't changed in
netif_rx.
So, I agree. 
Here is the new patch.

Signed-off-by: Wang Chen <[EMAIL PROTECTED]>
---
 smc911x.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.24.rc3.org/drivers/net/smc911x.c  2007-11-19 12:38:05.000000000 
+0800
+++ linux-2.6.24.rc3/drivers/net/smc911x.c      2007-12-04 09:59:06.000000000 
+0800
@@ -1299,9 +1299,9 @@ smc911x_rx_dma_irq(int dma, void *data)
        PRINT_PKT(skb->data, skb->len);
        dev->last_rx = jiffies;
        skb->protocol = eth_type_trans(skb, dev);
-       netif_rx(skb);
        dev->stats.rx_packets++;
        dev->stats.rx_bytes += skb->len;
+       netif_rx(skb);
 
        spin_lock_irqsave(&lp->lock, flags);
        pkts = (SMC_GET_RX_FIFO_INF() & RX_FIFO_INF_RXSUSED_) >> 16;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to