From: Alexey Dobriyan <adobriyan@gmail.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, johannes.berg@intel.com
Subject: [PATCH net-next] netlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32()
Date: Sat, 17 Apr 2021 14:38:07 +0300 [thread overview]
Message-ID: <YHrInysXIB+SQC5C@localhost.localdomain> (raw)
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(-)
--- 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);
next reply other threads:[~2021-04-17 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-17 11:38 Alexey Dobriyan [this message]
2021-04-19 23:10 ` [PATCH net-next] netlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32() patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YHrInysXIB+SQC5C@localhost.localdomain \
--to=adobriyan@gmail.com \
--cc=davem@davemloft.net \
--cc=johannes.berg@intel.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.