Search Linux Wireless

Re: [RFC 2/7] cfg80211: express channels with a KHz component

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

 



On 4/1/20 10:53 AM, Johannes Berg wrote:
> On Wed, 2020-04-01 at 10:30 -0700, Thomas Pedersen wrote:
>>>> +static int __ieee80211_frequency_to_channel(u32 freq)
>>>
>>> export the double-underscore helpers like this one instead? That'd still
>>> be less code overall, IMHO.
>>
>> I didn't want to change the interface for
>> ieee80211_frequency_to_channel(). It's a little confusing that one takes
>> MHz, but the __ieee80211_frequency_to_channel() takes KHz? By giving the
>> _khz() hint in the wrapper we were trying to make it explicit. Similar
>> to below.
> 
> Right. I think that's fine. I was just wondering if / thinking that it
> may be better to just export ieee80211_freq_khz_to_channel(), and
> express the other ones as inline function in terms of that?
> 
>>> And maybe here? In fact, how is __ieee80211_get_channel() even different
>>> from ieee80211_get_channel_khz()?
>>
>> It's not. I thought the _khz() hint was helpful for the reader to keep
>> the units straight.
> 
> Agree, but then you don't need the double-underscore version and can
> just express the old one in terms of the _khz one?
> 
>> What do you think about keeping the interfaces in place, but otherwise
>> converting them to inline functions (where it makes sense)?
> 
> Yes, I think that's what I had in mind.

OK I get it. That is a lot cleaner.

-- 
thomas



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

  Powered by Linux