Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hong zhi guo and committed by
David S. Miller
9631d79e e07ebea0

+6 -6
+6 -6
drivers/connector/connector.c
··· 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> ··· 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 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 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) ||