diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2021-04-17 14:38:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-19 15:41:28 -0700 |
commit | c6400e3fc3fa821a26a58cf867331e0877a4c56b (patch) | |
tree | f3b46f9c78bbfddfbda69854e3dad4ed2a6226ab /include/linux | |
parent | 6ecaf81d4ac6365f9284f9d68d74f7c209e74f98 (diff) | |
download | linux-stable-c6400e3fc3fa821a26a58cf867331e0877a4c56b.tar.gz linux-stable-c6400e3fc3fa821a26a58cf867331e0877a4c56b.tar.bz2 linux-stable-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>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netlink.h | 12 |
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); |