aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2021-04-17 14:38:07 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-19 15:41:28 -0700
commitc6400e3fc3fa821a26a58cf867331e0877a4c56b (patch)
treef3b46f9c78bbfddfbda69854e3dad4ed2a6226ab
parentnet: ethernet: mediatek: fix a typo bug in flow offloading (diff)
downloadlinux-dev-c6400e3fc3fa821a26a58cf867331e0877a4c56b.tar.xz
linux-dev-c6400e3fc3fa821a26a58cf867331e0877a4c56b.zip
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: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netlink.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 0bcf98098c5a..61b1c7fcc401 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -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);