diff options
author | Patrick McHardy <kaber@trash.net> | 2007-12-05 01:25:03 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:56:11 -0800 |
commit | 0ac41e81462de20f87242caac2b9084c202c33b7 (patch) | |
tree | 4978450cfe485614fc2c0ef962ebbfbc9dff5cf9 /net/netfilter | |
parent | c01cd429fc118c5db92475c5f08b307718aa4efc (diff) |
[NETFILTER]: {nf_netlink,ip,ip6}_queue: use list_for_each_entry
Use list_add_tail/list_for_each_entry instead of list_add and
list_for_each_prev as a preparation for switching to RCU.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 3a09f021065..74d5ed9490a 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -231,7 +231,7 @@ static inline void __enqueue_entry(struct nfqnl_instance *queue, struct nfqnl_queue_entry *entry) { - list_add(&entry->list, &queue->queue_list); + list_add_tail(&entry->list, &queue->queue_list); queue->queue_total++; } @@ -243,11 +243,9 @@ static inline struct nfqnl_queue_entry * __find_entry(struct nfqnl_instance *queue, nfqnl_cmpfn cmpfn, unsigned long data) { - struct list_head *p; - - list_for_each_prev(p, &queue->queue_list) { - struct nfqnl_queue_entry *entry = (struct nfqnl_queue_entry *)p; + struct nfqnl_queue_entry *entry; + list_for_each_entry(entry, &queue->queue_list, list) { if (!cmpfn || cmpfn(entry, data)) return entry; } |