Search Linux Wireless

Re: [PATCH v2 01/13] cfg80211: allow drivers to iterate over matching combinations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

So yeah.


Michał
--
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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux