On Fri, 2014-03-28 at 14:42 +0100, Michal Kazior wrote: > On 28 March 2014 14:22, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > > On Fri, 2014-03-28 at 14:21 +0100, Michal Kazior wrote: > > > >> >> +int cfg80211_iter_combinations(struct wiphy *wiphy, > >> >> + const int num_different_channels, > >> >> + const u8 radar_detect, > >> >> + const int iftype_num[NUM_NL80211_IFTYPES], > >> >> + void (*iter)(const struct ieee80211_iface_combination *c, > >> >> + void *data), > >> >> + void *data); > >> > > >> > Maybe *iter should have a non-void return value and allow aborting the > >> > loop somehow? > >> > >> I don't see much of use for that. You can still use *data for that. > > > > No, I meant to abort the iteration loop, say when the function returns > > true (or false, whichever way you want to look at it). That way you can > > stop iteration at the first combination that's sufficient. > > I know. It's just that it bothers me - if you use true/false you end > up with "do I use true for continue or break" (and need to put > comments in the code) and having an enum for such a trivial thing > seems silly too. On the other hand using *data to guard *iter is also > silly. Ok, let's leave it. It's not like we have a million combinations and iterating them is expensive ... johannes -- 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