Commit c6400e3f authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller

netlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32()

Taking address of a function argument directly works just fine.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6ecaf81d
......@@ -129,23 +129,19 @@ struct netlink_ext_ack {
static inline void nl_set_extack_cookie_u64(struct netlink_ext_ack *extack,
u64 cookie)
{
u64 __cookie = cookie;
if (!extack)
return;
memcpy(extack->cookie, &__cookie, sizeof(__cookie));
extack->cookie_len = sizeof(__cookie);
memcpy(extack->cookie, &cookie, sizeof(cookie));
extack->cookie_len = sizeof(cookie);
}
static inline void nl_set_extack_cookie_u32(struct netlink_ext_ack *extack,
u32 cookie)
{
u32 __cookie = cookie;
if (!extack)
return;
memcpy(extack->cookie, &__cookie, sizeof(__cookie));
extack->cookie_len = sizeof(__cookie);
memcpy(extack->cookie, &cookie, sizeof(cookie));
extack->cookie_len = sizeof(cookie);
}
void netlink_kernel_release(struct sock *sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment