Message ID | YHrInysXIB+SQC5C@localhost.localdomain (mailing list archive) |
---|---|
State | Accepted |
Commit | c6400e3fc3fa821a26a58cf867331e0877a4c56b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] netlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 3 maintainers not CCed: zhudi21@huawei.com marcelo.leitner@gmail.com kuba@kernel.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 7955 this patch: 7955 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 27 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 8168 this patch: 8168 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Sat, 17 Apr 2021 14:38:07 +0300 you wrote: > Taking address of a function argument directly works just fine. > > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> > --- > > include/linux/netlink.h | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) Here is the summary with links: - [net-next] netlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32() https://git.kernel.org/netdev/net-next/c/c6400e3fc3fa You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
--- 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);
Taking address of a function argument directly works just fine. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> --- include/linux/netlink.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)