Commit 9631d79e815197dbe90080aedfbab6de41218d85
Committed by
David S. Miller
1 parent
e07ebea0cc
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
connector: replace obsolete NLMSG_* with type safe nlmsg_*
Signed-off-by: Hong Zhiguo <honkiko@gmail.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff
drivers/connector/connector.c
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | #include <linux/module.h> |
24 | 24 | #include <linux/list.h> |
25 | 25 | #include <linux/skbuff.h> |
26 | -#include <linux/netlink.h> | |
26 | +#include <net/netlink.h> | |
27 | 27 | #include <linux/moduleparam.h> |
28 | 28 | #include <linux/connector.h> |
29 | 29 | #include <linux/slab.h> |
30 | 30 | |
31 | 31 | |
... | ... | @@ -95,13 +95,13 @@ |
95 | 95 | if (!netlink_has_listeners(dev->nls, group)) |
96 | 96 | return -ESRCH; |
97 | 97 | |
98 | - size = NLMSG_SPACE(sizeof(*msg) + msg->len); | |
98 | + size = sizeof(*msg) + msg->len; | |
99 | 99 | |
100 | - skb = alloc_skb(size, gfp_mask); | |
100 | + skb = nlmsg_new(size, gfp_mask); | |
101 | 101 | if (!skb) |
102 | 102 | return -ENOMEM; |
103 | 103 | |
104 | - nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size - sizeof(*nlh), 0); | |
104 | + nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size, 0); | |
105 | 105 | if (!nlh) { |
106 | 106 | kfree_skb(skb); |
107 | 107 | return -EMSGSIZE; |
... | ... | @@ -124,7 +124,7 @@ |
124 | 124 | { |
125 | 125 | struct cn_callback_entry *i, *cbq = NULL; |
126 | 126 | struct cn_dev *dev = &cdev; |
127 | - struct cn_msg *msg = NLMSG_DATA(nlmsg_hdr(skb)); | |
127 | + struct cn_msg *msg = nlmsg_data(nlmsg_hdr(skb)); | |
128 | 128 | struct netlink_skb_parms *nsp = &NETLINK_CB(skb); |
129 | 129 | int err = -ENODEV; |
130 | 130 | |
... | ... | @@ -162,7 +162,7 @@ |
162 | 162 | |
163 | 163 | skb = skb_get(__skb); |
164 | 164 | |
165 | - if (skb->len >= NLMSG_SPACE(0)) { | |
165 | + if (skb->len >= NLMSG_HDRLEN) { | |
166 | 166 | nlh = nlmsg_hdr(skb); |
167 | 167 | |
168 | 168 | if (nlh->nlmsg_len < sizeof(struct cn_msg) || |