Skip to content

Commit

Permalink
connector: Move cn_test.c away from NLMSG_PUT().
Browse files Browse the repository at this point in the history
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Jun 27, 2012
1 parent 85c9316 commit 8786395
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Documentation/connector/cn_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ static int cn_test_want_notify(void)
return -ENOMEM;
}

nlh = NLMSG_PUT(skb, 0, 0x123, NLMSG_DONE, size - sizeof(*nlh));
nlh = nlmsg_put(skb, 0, 0x123, NLMSG_DONE, size - sizeof(*nlh), 0);
if (!nlh) {
kfree_skb(skb);
return -EMSGSIZE;
}

msg = (struct cn_msg *)NLMSG_DATA(nlh);
msg = nlmsg_data(nlh);

memset(msg, 0, size0);

Expand Down Expand Up @@ -117,11 +121,6 @@ static int cn_test_want_notify(void)
pr_info("request was sent: group=0x%x\n", ctl->group);

return 0;

nlmsg_failure:
pr_err("failed to send %u.%u\n", msg->seq, msg->ack);
kfree_skb(skb);
return -EINVAL;
}
#endif

Expand Down

0 comments on commit 8786395

Please sign in to comment.