linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Antonio Quartulli <ordex@autistici.org>
Cc: linux-wireless@vger.kernel.org,
	Antonio Quartulli <antonio@open-mesh.com>
Subject: Re: [PATCHv4 1/4] mac80211: make mgmt_tx accept a NULL channel
Date: Tue, 11 Jun 2013 14:07:17 +0200	[thread overview]
Message-ID: <1370952437.8356.26.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <20130611115722.GD1466@ritirata.org>

On Tue, 2013-06-11 at 13:57 +0200, Antonio Quartulli wrote:
> On Tue, Jun 11, 2013 at 01:58:07PM +0200, Johannes Berg wrote:
> > On Tue, 2013-06-11 at 13:55 +0200, Johannes Berg wrote:
> > > On Wed, 2013-06-05 at 17:09 +0200, Antonio Quartulli wrote:
> > > 
> > > > +	if (need_offchan && !chan)
> > > > +		return -EINVAL;
> > > 
> > > > @@ -2847,10 +2853,14 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
> > > >  		rcu_read_lock();
> > > >  		chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> > > >  
> > > > -		if (chanctx_conf)
> > > > -			need_offchan = chan != chanctx_conf->def.chan;
> > > > -		else
> > > > +		if (chanctx_conf) {
> > > > +			need_offchan = chan && (chan != chanctx_conf->def.chan);
> > > > +		} else if (!chan) {
> > > > +			ret = -EINVAL;
> > > > +			goto out_unlock;
> > > > +		} else {
> > > >  			need_offchan = true;
> > > > +		}
> > > >  		rcu_read_unlock();
> > > 
> > > It seems this would be clearer?
> > > http://p.sipsolutions.net/b8a03c85f0e8b89f.txt
> > 
> > Actually, no, I like your version better.
> 
> uhm, having one else less looks better..why did you change your mind?
> Maybe you version is not entirely equivalent?

It's not, but that wouldn't matter, it's different I think only if you
have input from cfg80211 as "!chan && offchan".

It just seems to me that your version is clearer, first you check if you
need offchan, and if you do but don't have a channel you abort. Then you
check if you might need offchan for another reason, etc.

johannes


  reply	other threads:[~2013-06-11 12:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 15:09 [PATCHv4 1/4] mac80211: make mgmt_tx accept a NULL channel Antonio Quartulli
2013-06-05 15:09 ` [PATCHv4 2/4] brcm80211: make mgmt_tx in brcmfmac " Antonio Quartulli
2013-06-05 15:34   ` Arend van Spriel
2013-06-05 15:35     ` Arend van Spriel
2013-06-05 15:40       ` Johannes Berg
2013-06-05 16:58         ` Antonio Quartulli
2013-06-05 17:47         ` John W. Linville
2013-06-05 15:09 ` [PATCHv4 3/4] ath6kl: make mgmt_tx " Antonio Quartulli
2013-06-05 15:16   ` Kalle Valo
2013-06-05 15:09 ` [PATCHv4 4/4] nl80211: allow sending CMD_FRAME without specifying any frequency Antonio Quartulli
2013-06-11 11:53   ` Johannes Berg
2013-06-11 11:55     ` Antonio Quartulli
2013-06-11 11:55 ` [PATCHv4 1/4] mac80211: make mgmt_tx accept a NULL channel Johannes Berg
2013-06-11 11:56   ` Antonio Quartulli
2013-06-11 11:58   ` Johannes Berg
2013-06-11 11:57     ` Antonio Quartulli
2013-06-11 12:07       ` Johannes Berg [this message]
2013-06-11 12:07         ` Antonio Quartulli

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=1370952437.8356.26.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=antonio@open-mesh.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=ordex@autistici.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).