Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9be9a6b983314dd57e2c5ba548dee8b53d338ac3
Commit:     9be9a6b983314dd57e2c5ba548dee8b53d338ac3
Parent:     42dc9cd54b7290f862874a2544e50395e5719985
Author:     Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 20 17:02:45 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:29:22 2007 -0700

    [NET]: Get rid of netdev_nit
    
    It isn't any faster to test a boolean global variable than do a simple
    check for empty list.
    
    Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/dev.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index c8f5ea9..431998d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -226,12 +226,6 @@ extern void netdev_unregister_sysfs(struct net_device *);
 
*******************************************************************************/
 
 /*
- *     For efficiency
- */
-
-static int netdev_nit;
-
-/*
  *     Add a protocol ID to the list. Now that the input handler is
  *     smarter we can dispense with all the messy stuff that used to be
  *     here.
@@ -265,10 +259,9 @@ void dev_add_pack(struct packet_type *pt)
        int hash;
 
        spin_lock_bh(&ptype_lock);
-       if (pt->type == htons(ETH_P_ALL)) {
-               netdev_nit++;
+       if (pt->type == htons(ETH_P_ALL))
                list_add_rcu(&pt->list, &ptype_all);
-       } else {
+       else {
                hash = ntohs(pt->type) & 15;
                list_add_rcu(&pt->list, &ptype_base[hash]);
        }
@@ -295,10 +288,9 @@ void __dev_remove_pack(struct packet_type *pt)
 
        spin_lock_bh(&ptype_lock);
 
-       if (pt->type == htons(ETH_P_ALL)) {
-               netdev_nit--;
+       if (pt->type == htons(ETH_P_ALL))
                head = &ptype_all;
-       } else
+       else
                head = &ptype_base[ntohs(pt->type) & 15];
 
        list_for_each_entry(pt1, head, list) {
@@ -1330,7 +1322,7 @@ static int dev_gso_segment(struct sk_buff *skb)
 int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        if (likely(!skb->next)) {
-               if (netdev_nit)
+               if (!list_empty(&ptype_all))
                        dev_queue_xmit_nit(skb, dev);
 
                if (netif_needs_gso(dev, skb)) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to