summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2013-09-30 22:03:09 +0200
committerDavid S. Miller <davem@davemloft.net>2013-10-02 22:03:51 +0200
commit05742faf2512b94907f49b21581ed4667b9bd702 (patch)
tree0e71721ce729c4a74b821d9f4ab284763e3c189d /Documentation
parentconnector: use 'size' everywhere in cn_netlink_send() (diff)
downloadlinux-05742faf2512b94907f49b21581ed4667b9bd702.tar.xz
linux-05742faf2512b94907f49b21581ed4667b9bd702.zip
connector - documentation: simplify netlink message length assignment
Use the precalculated size instead of obfuscating the message length calculation by first subtracting the netlink header length from size and then use the NLMSG_LENGTH() macro to add it back again. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/connector/ucon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index 4848db8c71ff..8a4da64e02a8 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -71,7 +71,7 @@ static int netlink_send(int s, struct cn_msg *msg)
nlh->nlmsg_seq = seq++;
nlh->nlmsg_pid = getpid();
nlh->nlmsg_type = NLMSG_DONE;
- nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh));
+ nlh->nlmsg_len = size;
nlh->nlmsg_flags = 0;
m = NLMSG_DATA(nlh);