linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@gmail.com
Cc: linux-wireless@vger.kernel.org, Ben Greear <greearb@candelatech.com>
Subject: Re: [PATCH 2/2] wireless: Use first phyX name available when registering phy devices.
Date: Mon, 27 Sep 2010 18:17:23 +0200	[thread overview]
Message-ID: <1285604243.4043.25.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1285603646-7710-2-git-send-email-greearb@candelatech.com>

On Mon, 2010-09-27 at 09:07 -0700, greearb@gmail.com wrote:

> @@ -346,16 +332,36 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
>  
>  	if (unlikely(!wiphy_idx_valid(rdev->wiphy_idx))) {
>  		wiphy_counter--;
> +		goto too_many_devs;
> +	}

I believe the other path can also reduce the counter again, since it's
another failure case? Not that I'm really worried about it though.

> +	/* 64k wiphy devices is enough for anyone! */
> +	for (i = 0; i < 0xFFFF; i++) {

Come to think of it, this could be "i <= wiphy_counter", since in N
devices, only N different names can be in use, so checking N+1 names
will be sufficient, right?

johannes


  reply	other threads:[~2010-09-27 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-27 16:07 [PATCH 1/2] Revert "wireless: Keep phy name consistent across module reloads." greearb
2010-09-27 16:07 ` [PATCH 2/2] wireless: Use first phyX name available when registering phy devices greearb
2010-09-27 16:17   ` Johannes Berg [this message]
2010-09-27 16:39     ` Ben Greear

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=1285604243.4043.25.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=greearb@gmail.com \
    --cc=linux-wireless@vger.kernel.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).