Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1040643ybb; Wed, 1 Apr 2020 14:33:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvhSw968rgJRCZbO9TqOXwnH5hnpSopctuFP8whfzmd6jOPDPl7fZnNoHKANtORC4phv6+c X-Received: by 2002:a9d:3f62:: with SMTP id m89mr6809008otc.20.1585776832277; Wed, 01 Apr 2020 14:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585776832; cv=none; d=google.com; s=arc-20160816; b=mrV5fTZ6e//Ac0dE3LiN/IysxnMv5lcyvd/kh8lV1+zcHwSa3YCUilf1EKOS8I7BZc P2i58j/Qj2UcdH6RpY6JUPFDVQBOCu++qnbAmXrObLpRjd59+qSA1HIxxfDcYa7JxMzo HV4J58Z7RZwTzkEB3TS/6JKuN62C1Zs1/1vTmDl4H4/G8uFXKRvsmxaAlLz4G7kYDckj okYC1UbdyZq9HEnHXrk3ILMARfnUmrdzS91+W+/SowhWF79GDdLF0t+GrmqqHr2v7KBq up0//lYfPAnQwMRLyO+hX65xHTmyaLUCMWJzKoVnkfudQJzVU4dmc9l1HgKe1zAUCkrm 2LSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Lof/JzNTOjcKvnzV0pkX82oZz2AhKO08OGtCYU1YZJQ=; b=n/kwz5lqN3dW8CZG2tuyyXAbPraCEcknsTJJYUltV1NB3UcZkZqTVCje77vVHAleFH ZmYd/0cFFIdsMMgas7/sxWv+8+99TkkZ6tvAEre/DIVQRBJ1+pDaooo777hsmVf3L7Fu 07OwBIONVBIjD0xKFYmtg812F5+jhRqWVtGiJ5nUmhLslfMr2T7gEnE7fqObdn+7D2FM 9rROm0VarDD0JO2QQy02KOPDPmk/dRYcg1Pp5AoP+emaLSEzPEjxxwO9ymfG5w3vVGaQ /09V/TLRRToR+81xKv7R5leVLh2rlvy/ox3DpE1TVO9nCe0Leo4gPKwxCgL/HDMfAz4F GfWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si1421323otk.203.2020.04.01.14.33.25; Wed, 01 Apr 2020 14:33:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733178AbgDAVcv (ORCPT + 99 others); Wed, 1 Apr 2020 17:32:51 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:44668 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732337AbgDAVcv (ORCPT ); Wed, 1 Apr 2020 17:32:51 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 3673B4F7AAB; Wed, 1 Apr 2020 21:32:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ux6_uZI3X-Pg; Wed, 1 Apr 2020 21:32:47 +0000 (UTC) Received: from [10.1.15.6] (gateway.adapt-ip.com [173.164.178.20]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id 9332A4F7AA5; Wed, 1 Apr 2020 21:32:47 +0000 (UTC) Subject: Re: [RFC 2/7] cfg80211: express channels with a KHz component To: Johannes Berg Cc: linux-wireless References: <20200401062150.3324-1-thomas@adapt-ip.com> <20200401062150.3324-3-thomas@adapt-ip.com> <52850c8eb3131ca742eea30a21a7e685a3a3045b.camel@sipsolutions.net> <69451a0a-4bca-36f8-4295-9a386585c244@adapt-ip.com> From: Thomas Pedersen Message-ID: Date: Wed, 1 Apr 2020 14:32:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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