Search Linux Wireless

Re: [PATCH 5/6] cfg80211: make regulatory_request use wiphy_idx instead of wiphy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 13, 2009 at 1:24 PM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> On Fri, 2009-02-13 at 10:21 -0800, Luis R. Rodriguez wrote:
>> On Fri, Feb 13, 2009 at 3:04 AM, Johannes Berg
>> <johannes@xxxxxxxxxxxxxxxx> wrote:
>> > On Thu, 2009-02-12 at 21:36 -0800, Luis R. Rodriguez wrote:
>> >>
>> >> +       if (wiphy_idx_valid(last_request->wiphy_idx))
>> >> +               request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
>> >
>> > All this seems pointless, wiphy_idx_to_wiphy will just return NULL if
>> > the index isn't valid. This is in a number of places, and it's not like
>> > it being invalid will be happening often so we'd have to optimise for
>> > it.
>>
>> The check can be removed if the WARNING is removed on
>> wiphy_idx_to_wiphy(). I left it as I figured it'd be good to leave the
>> warning, your call.
>
> Dunno, I think no warning is probably better if more than half the
> callers would have to check first... Also, the warning seems like it
> could spuriously trigger if a wiphy is removed?

Yeah I think you're right.

> One other thing I noticed - why is there a conditional assert on the
> mutex? Shouldn't it always be locked?

The conditional assert on the mutex is there because on cfg80211 you
don't want to hold a mutex as that would mean userspace gets stuck
with one. I believe lockdep complained to me about it as exactly that.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux