linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Schurig <holgerschurig@gmail.com>
To: linux-wireless <linux-wireless@vger.kernel.org>
Cc: pat-lkml@erley.org, Holger Schurig <holgerschurig@googlemail.com>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH] cfg80211: introduce nl80211_get_ifidx()
Date: Tue, 10 Nov 2009 16:15:30 +0100	[thread overview]
Message-ID: <200911101615.30124.holgerschurig@gmail.com> (raw)
In-Reply-To: <05d7281ddd3780e3d7f4b485ce361b87@127.0.0.1>

On Tuesday 10 November 2009 15:50:43 pat-lkml@erley.org wrote:
> On Tue, 10 Nov 2009 12:51:43 +0100, Holger Schurig
> <holgerschurig@googlemail.com> wrote:
> 
> > @@ -3182,20 +3182,11 @@
> >  	int err;
> >  
> >  	if (!ifidx) {
> > -		err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize,
> > -				  nl80211_fam.attrbuf, nl80211_fam.maxattr,
> > -				  nl80211_policy);
> > -		if (err)
> > -			return err;
> > -
> > -		if (!nl80211_fam.attrbuf[NL80211_ATTR_IFINDEX])
> > -			return -EINVAL;
> > -
> > -		ifidx = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_IFINDEX]);
> > -		if (!ifidx)
> > -			return -EINVAL;
> > +		ifidx = nl80211_get_ifidx(cb);
> 
> do you need an:
> 
>  if(ifidx < 0)
>     return ifidx;
> 
> here, as you assign it to cb->args[0], which differs from the original
> behavior.


Do you mean

        if (!ifidx) {
               ifidx = nl80211_get_ifidx(cb);
               if (ifidx < 0)
                  return ifidx;
               cb->args[0] = ifidx;
        }
        if (ifidx < 0)
              return ifidx;

instead?



I'm not familiar with this function, but maybe we
can get away like this:

        int ifidx = cb->args[0];

        if (!ifidx)
               ifidx = nl80211_get_ifidx(cb);
        if (ifidx < 0)
              return ifidx;
        cb->args[0] = ifidx;

-- 
http://www.holgerschurig.de

  reply	other threads:[~2009-11-10 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10 11:51 [PATCH] cfg80211: introduce nl80211_get_ifidx() Holger Schurig
2009-11-10 14:50 ` pat-lkml
2009-11-10 15:15   ` Holger Schurig [this message]
2009-11-10 15:41     ` pat-lkml

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=200911101615.30124.holgerschurig@gmail.com \
    --to=holgerschurig@gmail.com \
    --cc=holgerschurig@googlemail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pat-lkml@erley.org \
    /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).