[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180930113252.7159eedd@shemminger-XPS-13-9360>
Date: Sun, 30 Sep 2018 11:32:52 +0200
From: Stephen Hemminger <stephen@...workplumber.org>
To: Li RongQing <lirongqing@...du.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH][net-next] ipv6: drop container_of when convert dst to
rt6_info
On Sun, 30 Sep 2018 13:02:52 +0800
Li RongQing <lirongqing@...du.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@...du.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.
Powered by blists - more mailing lists