]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
netlink: remove duplicated NLMSG_ALIGN
authorHong zhi guo <honkiko@gmail.com>
Mon, 25 Mar 2013 19:04:05 +0000 (19:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Mar 2013 16:40:05 +0000 (12:40 -0400)
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>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/netlink.h

index 78d5b8a546d63fb73cf45a2ab08a48ce02486dba..32a354f67ba4e8e15a59c411c90296ac8338a579 100644 (file)
@@ -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), \