Search Linux Wireless

Re: [PATCH] ath6kl: fix incorrect use of IEEE80211_NUM_BANDS

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


Hi Pavel,

sorry for the late reply, this got accidentally buried inside my todo
folder.

On 07/12/2012 08:48 PM, Pavel Roskin wrote:
> On Thu, 12 Jul 2012 12:13:12 +0300
> Kalle Valo <kvalo@xxxxxxxxxxxxxxxx> wrote:
> 
>> +	/* only check 2.4 and 5 GHz bands, skip the rest */
>> +	for (band = 0; band <= IEEE80211_BAND_5GHZ; band++) {
> 
> There is something inelegant here.  The code is mixing an integer and
> an enum.  I'd rather go with one or those:
> 
> two enums:
> for (band = IEEE80211_BAND_2GHZ; band <= IEEE80211_BAND_5GHZ; band++) {

I somewhat see your point. But IMHO zero is commonly used when iterating
over an enum to denote the first value and I don't see how
IEEE80211_BAND_2GHZ helps here.

> or two integers:
> for (band = 0; band <= ATH6KL_NUM_BANDS; band++) {

ATH6KL_NUM_BANDS is also an enum so I don't see the difference.

Kalle
--
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


[Linux Kernel]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]     [Free Dating]     [M2M Wireless]

Add to Google Powered by Linux