Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp839413iob; Wed, 18 May 2022 14:19:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv3G2m9FmzzFZAYXJvOgzLTl0kQZF5To6z/EtUI4DBFN4lR082000wbAsID8s/AxEm6xCq X-Received: by 2002:a05:6a02:19b:b0:39d:cfa:5cda with SMTP id bj27-20020a056a02019b00b0039d0cfa5cdamr1121983pgb.175.1652908776309; Wed, 18 May 2022 14:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652908776; cv=none; d=google.com; s=arc-20160816; b=BpiPhj1plnWB4v47iK1pK+QV4u94Cma+u0pS20agijTYGAJRRrxwClstR5+HN+JYxE j5T/bsY4BUxiSSEFkENldNLg83jOCFbuj6LQbbKBRW676VgiPOPZ8KyhdG9bVq/11ZEh 16IEfOALvGGnNGlvJzbnsrUtSOhS1u+M/qaqUHscmxZK07qdDjX/EtakfoZFVk9vaqFu hSFEW6FQ/KP+jnJjgdQ0EUn2Pr3w7lHEr648kUIrj6KeWxTVf5srPVbgTlSgQq7u+0a2 Lp4WiJPeG710sZvsqm0jS7zpt3cH74xNDnqR977R3q4ZzLR1AVRs7BMRCkyP+4Zzm+Bu s+qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5TAXv85sybfkVh2uXaxyRsEjnfyIHguGLkaoHwsn03U=; b=i/kbo+Lz/8yfO2bivTf0X5QvN78jNyOL4Hu9BV/3UT6gMWuf+qavUGxZ4RttN1f2gf fn/IaKp7HH0NCpO4yS7q+iesR1ZPoUTOg8IHGx6OQUKofUdu4prMAVxQoKpQRzLJBxGd PViwXBQb19zEdk8nrnxYLqaglqTH99niTipAWUYNHl0Ri8bFPwdchkYjDQtYNyMD6r4m +LFUxt+c0swKjTQEA8FvXzqI4ESWNeV+XL+GjtUg7FRX6SzrRZWXMxanHyQe+jDWtQVq 51PIVdgl27r5og1nmPocGxYo2LYpy2dYteJnz3MWhdYUey3g4C2krZguj/07dtYUjSuT HgmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="FXNn09X/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c3-20020a656183000000b003c247b0b459si4334423pgv.447.2022.05.18.14.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 14:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="FXNn09X/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CE1D82375F4; Wed, 18 May 2022 14:19:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243155AbiERVT3 (ORCPT + 71 others); Wed, 18 May 2022 17:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243133AbiERVT2 (ORCPT ); Wed, 18 May 2022 17:19:28 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1C3175690 for ; Wed, 18 May 2022 14:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652908767; x=1684444767; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=5TAXv85sybfkVh2uXaxyRsEjnfyIHguGLkaoHwsn03U=; b=FXNn09X/7mw3gfdLKvu2EDK3CtWufaZpBjHOnBtGqlzdLhWYnvv6MXSG cqT2HsnQTSpMKooNFftWNDKbbN7DmucBjFHHQ/qNxIjOa5hsl6TLB5OX0 4groVfYqxtXtKupHw8EyvLPfPfwMeD9OpJHJY+ai6cw3X26OPoUkhLhcl U=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 18 May 2022 14:19:27 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 14:19:27 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 18 May 2022 14:19:27 -0700 Received: from [10.110.66.23] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 18 May 2022 14:19:26 -0700 Message-ID: <7c05bbc5-c51f-2eb6-84a2-3a20c45b8b22@quicinc.com> Date: Wed, 18 May 2022 14:19:25 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2 2/9] ath9k: basic support for QCN550x Content-Language: en-US To: Wenli Looi CC: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , Kalle Valo , References: <20220512195319.14635-1-wlooi@ucalgary.ca> <20220512195319.14635-3-wlooi@ucalgary.ca> <69feb893-d73a-46e5-fbe6-2f49e091c625@quicinc.com> From: Jeff Johnson In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/17/2022 11:08 PM, Wenli Looi wrote: > On Thu, May 12, 2022 at 2:45 PM Jeff Johnson wrote: >> >> On 5/12/2022 12:53 PM, Wenli Looi wrote: >>> QCN550x is very similar to QCA956x. Note that AR_CH0_XTAL is >>> intentionally unchanged. Certain arrays are no longer static because >>> they are no longer constant. >> >> I don't understand the last sentence. You removed the 'static' keyword >> but left the 'const' keyword, hence they are still constant. >> >> And I didn't actually see any instances where the arrays are being modified. >> >> Can you highlight which are being modified? > > I changed several arrays from "static const" to "const" because their > values now depend on ah, so it won't compile if they are static. For > example, offset_array contains AR_PHY_RX_IQCAL_CORR_B0 which depends > on AR_CHAN_BASE (which now depends on ah but did not before). So the values are no longer constant, hence IMO the 'const' qualifier should also be removed > >>> -#define AR_CHAN_BASE 0x9800 >>> +#define AR_CHAN_BASE (AR_SREV_5502(ah) ? 0x29800 : 0x9800) >> >> this violates the coding style: >> >> >> Things to avoid when using macros: >> macros that depend on having a local variable with a magic name >> >> So you should add ah as a parameter to the macro >> >> Repeat for all instances below where ah is being used >> > > The macros like AR_CHAN_BASE and AR_SM_BASE are referenced by a lot of > other macros, some of which already have a "magic name" dependency on > ah like these ones: > > https://github.com/torvalds/linux/blob/210e04ff768142b96452030c4c2627512b30ad95/drivers/net/wireless/ath/ath9k/ar9003_phy.h#L527 > > However I think it's probably good to avoid introducing new macros > with the magic name dependency. If desired, for every macro that I > have modified, I could try to add the ah parameter to all dependent > macros. This would probably be a rather large change so it might make > sense to be a separate commit. Your current change illustrates one of the many pitfalls of using magic names. IMO you should have a precursor patch that changes all of the "bad" macros to take ah as a parameter rather than be a magic name. At a minimum you should add ah as a parameter to the ones you are modifying so that it is clear why you need to change the attributes of those arrays. /jeff