From: Johannes Berg <johannes@sipsolutions.net>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 05/19] cfg80211: processing core regulatory hints on its own
Date: Mon, 11 Nov 2013 15:41:02 +0100 [thread overview]
Message-ID: <1384180862.14334.25.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <CAGRGNgXdnwYnNYncPQGp=NNF1FxY3sFMSSf7arWYeX3v=PFAzw@mail.gmail.com> (sfid-20131107_014742_750163_B1BE1A20)
On Thu, 2013-11-07 at 11:47 +1100, Julian Calaby wrote:
> >>> - switch (__regulatory_hint(wiphy, reg_request)) {
> >>> + switch (reg_request->initiator) {
> >>> + case NL80211_REGDOM_SET_BY_CORE:
> >>> + reg_process_hint_core(reg_request);
> >>> + return;
> >
> > Note that for the core request we bail out early.
> >
> >>> + case NL80211_REGDOM_SET_BY_USER:
> >>> + case NL80211_REGDOM_SET_BY_DRIVER:
> >>> + case NL80211_REGDOM_SET_BY_COUNTRY_IE:
> >>> + treatment = __regulatory_hint(wiphy, reg_request);
> >>> + break;
> >>> + }
> >>> +
> >>> + switch (treatment) {
> >>
> >> is used uninitialized here
> >
> > As I see it in the code we either bail early or its assigned to the
> > return value of __regulatory_hint() for the non-core case. Did I miss
> > something?
>
> I think Johannes just wants you to assign something to it so that
> paranoid static checkers / compilers won't complain that it's unset in
> the potential case where we make it through the switch without hitting
> any of the cases. (Adding a default: case to the switch statement
> would also work, but as you've been very very careful to spell out all
> the cases here that'd tempt developers to remove all the careful
> spelling out in some crazed cleanup binge.)
>
> Of course this will never happen if reg_request->initiator is an enum
> and all it's possible values are covered in the switch statement, but
> some compilers (and developers like me) need it spelled out for them.
Well actually I was just careless and didn't realize that it was
actually a false compiler warning :)
johannes
next prev parent reply other threads:[~2013-11-11 14:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 17:17 [PATCH 00/19] cfg80211: regulatory updates Luis R. Rodriguez
2013-11-05 17:17 ` [PATCH 01/19] cfg80211: enforce disabling channels by custom or strict settings Luis R. Rodriguez
2013-11-06 10:15 ` Johannes Berg
2013-11-06 16:54 ` Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 02/19] cfg80211: force WIPHY_FLAG_CUSTOM_REGULATORY on wiphy_apply_custom_regulatory() Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 03/19] cfg80211: check regulatory request alpha2 early Luis R. Rodriguez
2013-11-06 10:17 ` Johannes Berg
2013-11-06 16:39 ` Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 04/19] cfg80211: remove second argument from reg_process_hint() Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 05/19] cfg80211: processing core regulatory hints on its own Luis R. Rodriguez
2013-11-06 10:24 ` Johannes Berg
2013-11-06 10:26 ` Johannes Berg
2013-11-06 16:35 ` Luis R. Rodriguez
2013-11-07 0:47 ` Julian Calaby
2013-11-11 14:41 ` Johannes Berg [this message]
2013-11-05 17:18 ` [PATCH 06/19] cfg80211: process user regulatory requests " Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 07/19] cfg80211: process driver " Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 08/19] cfg80211: process country IE regulatory requests on their own Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 09/19] cfg80211: process non country IE conflicting first Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 10/19] cfg80211: add helper for kfree'ing last_request Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 11/19] cfg80211: add helper for kfree'ing and assigning last_request Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 12/19] cfg80211: add helper for calling CRDA Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 13/19] cfg80211: allow only the core to request to update the world regdom Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 14/19] cfg80211: move core reg_notfier() check to source Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 15/19] cfg80211: pass the last_request to __set_regdom() Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 16/19] cfg80211: set core regulatory updates on its own Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 17/19] cfg80211: set user " Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 18/19] cfg80211: set driver " Luis R. Rodriguez
2013-11-05 17:18 ` [PATCH 19/19] cfg80211: rename __set_regdom() to reg_set_rd_country_ie() Luis R. Rodriguez
2013-11-11 14:50 ` [PATCH 00/19] cfg80211: regulatory updates Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384180862.14334.25.camel@jlt4.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=julian.calaby@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@do-not-panic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).