Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-17 Thread Johannes Berg
On Thu, 2015-12-17 at 03:01 -0800, Joe Perches wrote: > Following patterns is good, I just think the > pattern could be trivially improved. It's a question of what makes sense though - nobody implements stop_xyz without implementing start_xyz, and even if they do it's pointless. It's just that

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-17 Thread Joe Perches
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... > >

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-17 Thread Ola Olsson
> 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. > > Didn't think about that. Love your bit fiddling trick! After an approval/rejection of my patch I can submit another one

[PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-16 Thread Ola Olsson
Print a warning whenever an expected callback function lacks implementation. Signed-off-by: Ola Olsson --- net/wireless/core.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index b091551..3a9c41b 100644 ---

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-16 Thread Joe Perches
On Thu, 2015-12-17 at 05:19 +0100, Ola Olsson wrote: > Hi Joe, > > > maybe all of these should be a nand b? > > You're right but i don't understand where the problem is. Please help > me. > The code is currently like:        WARN_ON(ops->add_station && !ops->del_station);   but maybe it

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-16 Thread Joe Perches
On Wed, 2015-12-16 at 22:43 +0100, Ola Olsson wrote: > Print a warning whenever an expected callback function > lacks implementation. > > Signed-off-by: Ola Olsson > --- >  net/wireless/core.c |   10 ++ >  1 file changed, 10 insertions(+) > > diff --git

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-16 Thread Ola Olsson
> 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