提交 8f2ddaac 编写于 作者: H Herbert Xu 提交者: David S. Miller

netlink: Remove netlink_compare_arg.trailer

Instead of computing the offset from trailer, this patch computes
netlink_compare_arg_len from the offset of portid and then adds 4
to it.  This allows trailer to be removed.
Reported-by: NDavid Miller <davem@davemloft.net>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 69a3b16f
...@@ -974,10 +974,11 @@ struct netlink_compare_arg ...@@ -974,10 +974,11 @@ struct netlink_compare_arg
{ {
possible_net_t pnet; possible_net_t pnet;
u32 portid; u32 portid;
char trailer[];
}; };
#define netlink_compare_arg_len offsetof(struct netlink_compare_arg, trailer) /* Doing sizeof directly may yield 4 extra bytes on 64-bit. */
#define netlink_compare_arg_len \
(offsetof(struct netlink_compare_arg, portid) + sizeof(u32))
static inline int netlink_compare(struct rhashtable_compare_arg *arg, static inline int netlink_compare(struct rhashtable_compare_arg *arg,
const void *ptr) const void *ptr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册