Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752734Ab3C0QzL (ORCPT ); Wed, 27 Mar 2013 12:55:11 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:35859 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265Ab3C0QzJ (ORCPT ); Wed, 27 Mar 2013 12:55:09 -0400 From: Hong Zhiguo To: linux-kernel@vger.kernel.org Cc: zbr@ioremap.net, netdev@vger.kernel.org, davem@davemloft.net, tgraf@suug.ch Subject: [PATCH 6/6] connector: replace obsolete NLMSG_* with type safe nlmsg_* Date: Thu, 28 Mar 2013 00:54:56 +0800 Message-Id: <1364403296-32880-1-git-send-email-honkiko@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1915 Lines: 61 Signed-off-by: Hong Zhiguo --- drivers/connector/connector.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index f1b7e24..6ecfa75 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -95,13 +95,13 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask) if (!netlink_has_listeners(dev->nls, group)) return -ESRCH; - size = NLMSG_SPACE(sizeof(*msg) + msg->len); + size = sizeof(*msg) + msg->len; - skb = alloc_skb(size, gfp_mask); + skb = nlmsg_new(size, gfp_mask); if (!skb) return -ENOMEM; - nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size - sizeof(*nlh), 0); + nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size, 0); if (!nlh) { kfree_skb(skb); return -EMSGSIZE; @@ -124,7 +124,7 @@ static int cn_call_callback(struct sk_buff *skb) { struct cn_callback_entry *i, *cbq = NULL; struct cn_dev *dev = &cdev; - struct cn_msg *msg = NLMSG_DATA(nlmsg_hdr(skb)); + struct cn_msg *msg = nlmsg_data(nlmsg_hdr(skb)); struct netlink_skb_parms *nsp = &NETLINK_CB(skb); int err = -ENODEV; @@ -162,7 +162,7 @@ static void cn_rx_skb(struct sk_buff *__skb) skb = skb_get(__skb); - if (skb->len >= NLMSG_SPACE(0)) { + if (skb->len >= NLMSG_HDRLEN) { nlh = nlmsg_hdr(skb); if (nlh->nlmsg_len < sizeof(struct cn_msg) || -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/