From: Hong Zhiguo <honkiko@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, stephen@networkplumber.org, zhiguo.hong@emc.com
Subject: [PATCH net-next] netlink: remove duplicated NLMSG_ALIGN
Date: Tue, 26 Mar 2013 13:04:05 +0800 [thread overview]
Message-ID: <1364274245-20689-1-git-send-email-honkiko@gmail.com> (raw)
NLMSG_HDRLEN is already aligned value. It's for directly reference
without extra alignment.
The redundant alignment here may confuse the API users.
Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
---
include/uapi/linux/netlink.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
index 78d5b8a..32a354f 100644
--- a/include/uapi/linux/netlink.h
+++ b/include/uapi/linux/netlink.h
@@ -78,7 +78,7 @@ struct nlmsghdr {
#define NLMSG_ALIGNTO 4U
#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
-#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
+#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
--
1.7.10.4
next reply other threads:[~2013-03-26 5:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 5:04 Hong Zhiguo [this message]
2013-03-26 11:13 ` [PATCH net-next] netlink: remove duplicated NLMSG_ALIGN Thomas Graf
2013-03-26 16:40 ` David Miller
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=1364274245-20689-1-git-send-email-honkiko@gmail.com \
--to=honkiko@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=zhiguo.hong@emc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).