linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: Eliad Peller <eliad@wizery.com>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>,
	linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	sameo@linux.intel.com, johannes@sipsolutions.net,
	lauro.venancio@openbossa.org, marcio.macedo@openbossa.org,
	Waldemar.Rymarkiewicz@tieto.com
Subject: Re: [RFC][PATCH v2 3/7] NFC: add nfc generic netlink interface
Date: Wed, 22 Jun 2011 17:03:27 -0300	[thread overview]
Message-ID: <20110622200326.GC2583@joana> (raw)
In-Reply-To: <BANLkTikdLv6JuNRd1qL-_Jje_4GFDT4tOQ@mail.gmail.com>

Hi Eliad,

* Eliad Peller <eliad@wizery.com> [2011-06-22 01:15:42 +0300]:

> On Wed, Jun 22, 2011 at 1:05 AM, Gustavo F. Padovan
> <padovan@profusion.mobi> wrote:
> >> +static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target,
> >> +                                     struct netlink_callback *cb, int flags)
> >> +{
> >> +     void *hdr;
> >> +
> >> +     pr_debug("%s\n", __func__);
> >> +
> >> +     hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq,
> >> +                             &nfc_genl_family, flags, NFC_CMD_GET_TARGET);
> >> +     if (!hdr)
> >> +             return -EMSGSIZE;
> >> +
> >> +     genl_dump_check_consistent(cb, hdr, &nfc_genl_family);
> >> +
> >> +     NLA_PUT_U32(msg, NFC_ATTR_TARGET_INDEX, target->idx);
> >> +     NLA_PUT_U32(msg, NFC_ATTR_PROTOCOLS,
> >> +                             target->supported_protocols);
> >> +     NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res);
> >> +     NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res);
> >> +
> >> +     return genlmsg_end(msg, hdr);
> >> +
> >> +nla_put_failure:
> >
> > There is no use for this macro in all function that have a label with this
> > name.
> 
> the NLA_PUT_* macros use this label:
> 
> #define NLA_PUT(skb, attrtype, attrlen, data) \
> 	do { \
> 		if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \
> 			goto nla_put_failure; \
> 	} while(0)

Nice to know, I'm not a netlink expert. Thanks.

	Gustavo

  reply	other threads:[~2011-06-22 20:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 17:50 [RFC][PATCH v2 0/7] NFC subsystem Aloisio Almeida Jr
2011-06-20 17:50 ` [RFC][PATCH v2 1/7] netlink: advertise incomplete dumps Aloisio Almeida Jr
2011-06-20 17:50 ` [RFC][PATCH v2 2/7] NFC: add nfc subsystem core Aloisio Almeida Jr
2011-06-21 21:55   ` Gustavo F. Padovan
2011-06-22  2:24     ` Marcel Holtmann
2011-06-22 14:18       ` Aloisio Almeida
2011-06-20 17:50 ` [RFC][PATCH v2 3/7] NFC: add nfc generic netlink interface Aloisio Almeida Jr
2011-06-21 22:05   ` Gustavo F. Padovan
2011-06-21 22:15     ` Eliad Peller
2011-06-22 20:03       ` Gustavo F. Padovan [this message]
2011-06-22  6:56     ` Johannes Berg
2011-06-22 19:55       ` Gustavo F. Padovan
2011-06-22 14:07     ` Aloisio Almeida
2011-06-22  7:34   ` Johannes Berg
2011-06-22 12:57     ` Samuel Ortiz
2011-06-22 13:08       ` Johannes Berg
2011-06-22 13:27         ` Samuel Ortiz
2011-06-22 16:49     ` Aloisio Almeida
2011-06-23  7:55   ` Johannes Berg
2011-06-20 17:50 ` [RFC][PATCH v2 4/7] NFC: add NFC socket family Aloisio Almeida Jr
2011-06-20 17:50 ` [RFC][PATCH v2 5/7] NFC: add the NFC socket raw protocol Aloisio Almeida Jr
2011-06-20 17:50 ` [RFC][PATCH v2 6/7] NFC: pn533: add NXP pn533 nfc device driver Aloisio Almeida Jr
2011-06-20 17:50 ` [RFC][PATCH v2 7/7] NFC: add Documentation/networking/nfc.txt Aloisio Almeida Jr
2011-06-20 20:24   ` [RFC][PATCH v3 " Aloisio Almeida Jr
2011-06-21 21:23     ` Randy Dunlap
2011-06-22 14:13       ` Aloisio Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110622200326.GC2583@joana \
    --to=padovan@profusion.mobi \
    --cc=Waldemar.Rymarkiewicz@tieto.com \
    --cc=aloisio.almeida@openbossa.org \
    --cc=eliad@wizery.com \
    --cc=johannes@sipsolutions.net \
    --cc=lauro.venancio@openbossa.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=marcio.macedo@openbossa.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).