On Mon, Apr 08, 2013 at 07:04:58PM +0200, Simon Wunderlich wrote: [...] > @@ -108,6 +128,13 @@ static void ieee80211_free_chanctx(struct ieee80211_local *local, > chandef->width = NL80211_CHAN_WIDTH_20_NOHT; > chandef->center_freq1 = chandef->chan->center_freq; > chandef->center_freq2 = 0; > + > + /* NOTE: Disabling radar he is only valid here for typo? ^^ > + * single channel context. To be sure, check it ... */ > + if (local->hw.conf.radar_enabled) > + check_single_channel = true; > + local->hw.conf.radar_enabled = false; > + > ieee80211_hw_config(local, 0); > } else { > drv_remove_chanctx(local, ctx); > @@ -116,6 +143,10 @@ static void ieee80211_free_chanctx(struct ieee80211_local *local, > list_del_rcu(&ctx->list); > kfree_rcu(ctx, rcu_head); > > + /* throw a warning if this wasn't the only channel context. */ > + if (check_single_channel) > + WARN_ON(!list_empty(&local->chanctx_list)); > + Why not using WARN_ON(check_single_channel && !list_empty(&local->chanctx_list)); ? Moving the entire condition in the WARN_ON will optimise it all for being 'unlikely'. But Johannes can simply destroy my comment if he thinks it is wrong :) Cheers, -- Antonio Quartulli ..each of us alone is worth nothing.. Ernesto "Che" Guevara
Attachment:
pgpN9Wy5ZY506.pgp
Description: PGP signature