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, 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?

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

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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