Hi Luis, On Thu, Nov 7, 2013 at 3:35 AM, Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx> wrote: > On Wed, Nov 6, 2013 at 2:24 AM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: >> On Tue, 2013-11-05 at 09:18 -0800, Luis R. Rodriguez wrote: >> >>> struct wiphy *wiphy = NULL; >>> + enum reg_request_treatment treatment; >> >> This >> >>> if (WARN_ON(!reg_request->alpha2)) >>> return; >>> @@ -1552,7 +1580,18 @@ static void reg_process_hint(struct regulatory_request *reg_request) >>> return; >>> } >>> >>> - 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. Thanks, -- Julian Calaby Email: julian.calaby@xxxxxxxxx Profile: http://www.google.com/profiles/julian.calaby/ .Plan: http://sites.google.com/site/juliancalaby/ -- 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