Search Linux Wireless

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

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

 



On Thu, 2015-12-17 at 08:57 +0100, Johannes Berg wrote:
> On Thu, 2015-12-17 at 08:34 +0100, Ola Olsson wrote:
> > > but maybe it should be
> > > 
> > >         WARN_ON((ops->add_station && !ops->del_station) ||
> > >                 (!opt->add_station && ops->del_station))
> > > 
> > > etc...
> > 
> > Ahh, got it! I really like your idea but I assume it's quite rare to
> > implement the "stop/del/leave/disconnect" callbacks and at the same
> > time forget to implement the "start/add/join/connect". You will
> > probably find out pretty quickly if the "start" functions are
> > missing,
> > while it might take some time debugging why you lack the "stop"
> > functions (reinitialization issues/ resource leaks for example).
> > 
> > With that said, don't take my word for it, I was only following the
> > existing pattern and I assume someone else had a good reason in the
> > first place.
> > 
> 
> Pretty much what you said :)

Following patterns is good, I just think the
pattern could be trivially improved.

The test is a runtime check on what would ideally
be done at compile time.

Using
	WARN_ON(!a ^ !b)
which is logically the same as what I wrote above
for clarity is simply a bit more coverage and maybe
even a bit run-time faster.


--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux