This cleans up netpoll_send_skb: * np and np->dev are always non-null given the local callers * get device into a local variable
Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- orig/net/core/netpoll.c 2006-10-18 13:44:27.000000000 -0700 +++ new/net/core/netpoll.c 2006-10-18 13:46:03.000000000 -0700 @@ -270,19 +270,19 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) { + struct net_device *dev = np->dev; + struct netpoll_info *npinfo = dev->npinfo; int status; - struct netpoll_info *npinfo; - if (!np || !np->dev || !netif_device_present(np->dev) || !netif_running(np->dev)) { + if (!netif_device_present(dev) || !netif_running(dev)) { __kfree_skb(skb); return; } - npinfo = np->dev->npinfo; /* avoid recursion */ if (npinfo->poll_owner == smp_processor_id() || - np->dev->xmit_lock_owner == smp_processor_id()) { + dev->xmit_lock_owner == smp_processor_id()) { if (np->drop) np->drop(skb); else @@ -292,17 +292,17 @@ do { npinfo->tries--; - netif_tx_lock(np->dev); + netif_tx_lock(dev); /* * network drivers do not expect to be called if the queue is * stopped. */ status = NETDEV_TX_BUSY; - if (!netif_queue_stopped(np->dev)) - status = np->dev->hard_start_xmit(skb, np->dev); + if (!netif_queue_stopped(dev)) + status = dev->hard_start_xmit(skb, dev); - netif_tx_unlock(np->dev); + netif_tx_unlock(dev); /* success */ if(!status) { - 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