From: Stephen Hemminger <stephen@networkplumber.org>
To: Li RongQing <lirongqing@baidu.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info
Date: Sun, 30 Sep 2018 11:32:52 +0200 [thread overview]
Message-ID: <20180930113252.7159eedd@shemminger-XPS-13-9360> (raw)
In-Reply-To: <1538283772-23985-1-git-send-email-lirongqing@baidu.com>
On Sun, 30 Sep 2018 13:02:52 +0800
Li RongQing <lirongqing@baidu.com> wrote:
> we can save container_of computation and return dst directly,
> since dst is always first member of struct rt6_info
>
> Add a BUILD_BUG_ON() to catch any change that could break this
> assertion.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
I don't understand why you are doing this? It is not going to be
faster (or safer) than container_of. container_of provides the
same functionality and is safe against position of the member
in the structure.
next prev parent reply other threads:[~2018-09-30 16:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-30 5:02 [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info Li RongQing
2018-09-30 9:27 ` Li RongQing
2018-09-30 9:32 ` Stephen Hemminger [this message]
2018-09-30 9:38 ` Li RongQing
2018-09-30 15:29 ` David Ahern
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=20180930113252.7159eedd@shemminger-XPS-13-9360 \
--to=stephen@networkplumber.org \
--cc=lirongqing@baidu.com \
--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