Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c7b6ea24b43afb5749cb704e143df19d70e23dea
Commit:     c7b6ea24b43afb5749cb704e143df19d70e23dea
Parent:     33f807ba0d9259e7c75c7a2ce8bd2787e5b540c7
Author:     Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 19 19:37:09 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:54:18 2008 -0800

    [NETPOLL]: Don't need rx_flags.
    
    The rx_flags variable is redundant. Turning rx on/off is done
    via setting the rx_np pointer.
    
    Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/netpoll.h |    7 +++----
 net/core/netpoll.c      |    4 ----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index e3d7959..a0525a1 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -25,7 +25,6 @@ struct netpoll {
 
 struct netpoll_info {
        atomic_t refcnt;
-       int rx_flags;
        spinlock_t rx_lock;
        struct netpoll *rx_np; /* netpoll that registered an rx_hook */
        struct sk_buff_head arp_tx; /* list of arp requests to reply to */
@@ -51,12 +50,12 @@ static inline int netpoll_rx(struct sk_buff *skb)
        unsigned long flags;
        int ret = 0;
 
-       if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags))
+       if (!npinfo || !npinfo->rx_np)
                return 0;
 
        spin_lock_irqsave(&npinfo->rx_lock, flags);
-       /* check rx_flags again with the lock held */
-       if (npinfo->rx_flags && __netpoll_rx(skb))
+       /* check rx_np again with the lock held */
+       if (npinfo->rx_np && __netpoll_rx(skb))
                ret = 1;
        spin_unlock_irqrestore(&npinfo->rx_lock, flags);
 
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 9e3aea0..b1d5acd 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -39,7 +39,6 @@ static struct sk_buff_head skb_pool;
 static atomic_t trapped;
 
 #define USEC_PER_POLL  50
-#define NETPOLL_RX_ENABLED  1
 
 #define MAX_SKB_SIZE \
                (MAX_UDP_CHUNK + sizeof(struct udphdr) + \
@@ -675,7 +674,6 @@ int netpoll_setup(struct netpoll *np)
                        goto release;
                }
 
-               npinfo->rx_flags = 0;
                npinfo->rx_np = NULL;
 
                spin_lock_init(&npinfo->rx_lock);
@@ -757,7 +755,6 @@ int netpoll_setup(struct netpoll *np)
 
        if (np->rx_hook) {
                spin_lock_irqsave(&npinfo->rx_lock, flags);
-               npinfo->rx_flags |= NETPOLL_RX_ENABLED;
                npinfo->rx_np = np;
                spin_unlock_irqrestore(&npinfo->rx_lock, flags);
        }
@@ -799,7 +796,6 @@ void netpoll_cleanup(struct netpoll *np)
                        if (npinfo->rx_np == np) {
                                spin_lock_irqsave(&npinfo->rx_lock, flags);
                                npinfo->rx_np = NULL;
-                               npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;
                                spin_unlock_irqrestore(&npinfo->rx_lock, flags);
                        }
 
-
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