From: Pavel Emelyanov <xemul@openvz.org>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH] Evict tmp variable from the stack in ip6_evictor
Date: Wed, 10 Oct 2007 18:29:28 +0400 [thread overview]
Message-ID: <470CE1C8.9020000@openvz.org> (raw)
The list_head *tmp is used to help getting the first entry in
the ip6_frag_lru_list list. There is a simpler way to do it.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 31601c9..8fad98b 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -261,7 +261,6 @@ static __inline__ void fq_kill(struct fr
static void ip6_evictor(struct inet6_dev *idev)
{
struct frag_queue *fq;
- struct list_head *tmp;
int work;
work = atomic_read(&ip6_frag_mem) - sysctl_ip6frag_low_thresh;
@@ -274,8 +273,9 @@ static void ip6_evictor(struct inet6_dev
read_unlock(&ip6_frag_lock);
return;
}
- tmp = ip6_frag_lru_list.next;
- fq = list_entry(tmp, struct frag_queue, lru_list);
+
+ fq = list_first_entry(&ip6_frag_lru_list,
+ struct frag_queue, lru_list);
atomic_inc(&fq->refcnt);
read_unlock(&ip6_frag_lock);
next reply other threads:[~2007-10-10 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-10 14:29 Pavel Emelyanov [this message]
2007-10-10 14:37 ` [PATCH] Evict tmp variable from the stack in ip6_evictor Patrick McHardy
2007-10-10 14:52 ` Pavel Emelyanov
2007-10-10 15:06 ` Patrick McHardy
2007-10-10 23:31 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=470CE1C8.9020000@openvz.org \
--to=xemul@openvz.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).