On 9/30/18 3:38 AM, Li RongQing wrote:
>>
>> 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.
>>
>
> In fact, most places are conv
>
> 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.
>
In fact, most places are converting dst to rt6_info directly, and only
few pla
On Sun, 30 Sep 2018 13:02:52 +0800
Li RongQing 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
I don't un
> + BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
> +
please drop this patch, thanks
since BUILD_BUG_ON has been added in ip6_fib.h
include/net/ip6_fib.h: BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
-Li
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
---
include/net/ip6_route.h | 4 +++-
net/ipv6/route.c| 6 +++---
2 file