From: Andrew Morton <akpm@osdl.org>
To: "Robert P. J. Day" <rpjday@mindspring.com>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Simplify some code to use the container_of() macro.
Date: Wed, 3 Jan 2007 16:50:34 -0800 [thread overview]
Message-ID: <20070103165034.13935d8a.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0612311547200.30821@localhost.localdomain>
On Sun, 31 Dec 2006 15:55:22 -0500 (EST)
"Robert P. J. Day" <rpjday@mindspring.com> wrote:
> --- a/net/ipv4/netfilter/nf_nat_core.c
> +++ b/net/ipv4/netfilter/nf_nat_core.c
> @@ -168,7 +168,7 @@ find_appropriate_src(const struct nf_conntrack_tuple *tuple,
>
> read_lock_bh(&nf_nat_lock);
> list_for_each_entry(nat, &bysource[h], info.bysource) {
> - ct = (struct nf_conn *)((char *)nat - offsetof(struct nf_conn, data));
> + ct = container_of(nat, struct nf_conn, data);
This one isn't right. Please always carefully compile-test these things.
next prev parent reply other threads:[~2007-01-04 0:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-31 20:55 Robert P. J. Day
2007-01-04 0:50 ` Andrew Morton [this message]
2007-01-04 7:40 ` Robert P. J. Day
2007-01-04 7:59 ` Robert P. J. Day
2007-01-04 8:42 ` Thomas Hisch
2007-01-04 8:48 ` Robert P. J. Day
2007-02-04 14:29 ` [PATCH] ipv4: remove a call to skb_queue_len() in inet_diag.c Thomas Hisch
2007-02-04 20:23 ` 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=20070103165034.13935d8a.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpjday@mindspring.com \
/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
Powered by JetHome