diff options
author | Hong zhi guo <honkiko@gmail.com> | 2013-03-27 02:54:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-28 14:27:44 -0400 |
commit | 9631d79e815197dbe90080aedfbab6de41218d85 (patch) | |
tree | 856a570ae6476cbd628d1e822444e0bf08f73fbd /drivers/connector | |
parent | e07ebea0ccfaf627464460eb57d7f2fdbcccf8ec (diff) |
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>
Diffstat (limited to 'drivers/connector')
-rw-r--r-- | drivers/connector/connector.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index f1b7e244bfc1..6ecfa758942c 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
26 | #include <linux/netlink.h> | 26 | #include <net/netlink.h> |
27 | #include <linux/moduleparam.h> | 27 | #include <linux/moduleparam.h> |
28 | #include <linux/connector.h> | 28 | #include <linux/connector.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
@@ -95,13 +95,13 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask) | |||
95 | if (!netlink_has_listeners(dev->nls, group)) | 95 | if (!netlink_has_listeners(dev->nls, group)) |
96 | return -ESRCH; | 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 | if (!skb) | 101 | if (!skb) |
102 | return -ENOMEM; | 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 | if (!nlh) { | 105 | if (!nlh) { |
106 | kfree_skb(skb); | 106 | kfree_skb(skb); |
107 | return -EMSGSIZE; | 107 | return -EMSGSIZE; |
@@ -124,7 +124,7 @@ static int cn_call_callback(struct sk_buff *skb) | |||
124 | { | 124 | { |
125 | struct cn_callback_entry *i, *cbq = NULL; | 125 | struct cn_callback_entry *i, *cbq = NULL; |
126 | struct cn_dev *dev = &cdev; | 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 | struct netlink_skb_parms *nsp = &NETLINK_CB(skb); | 128 | struct netlink_skb_parms *nsp = &NETLINK_CB(skb); |
129 | int err = -ENODEV; | 129 | int err = -ENODEV; |
130 | 130 | ||
@@ -162,7 +162,7 @@ static void cn_rx_skb(struct sk_buff *__skb) | |||
162 | 162 | ||
163 | skb = skb_get(__skb); | 163 | skb = skb_get(__skb); |
164 | 164 | ||
165 | if (skb->len >= NLMSG_SPACE(0)) { | 165 | if (skb->len >= NLMSG_HDRLEN) { |
166 | nlh = nlmsg_hdr(skb); | 166 | nlh = nlmsg_hdr(skb); |
167 | 167 | ||
168 | if (nlh->nlmsg_len < sizeof(struct cn_msg) || | 168 | if (nlh->nlmsg_len < sizeof(struct cn_msg) || |