Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp185212iob; Tue, 17 May 2022 23:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG2agR8EmbZKRn0RjUBdPPfV4UcT2uXWS/bGWlBfK94Mf2e5ns5q7l6qD32MEKTisGj39W X-Received: by 2002:a17:90b:1d87:b0:1dc:a9c0:3d49 with SMTP id pf7-20020a17090b1d8700b001dca9c03d49mr40693637pjb.12.1652854140145; Tue, 17 May 2022 23:09:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652854140; cv=pass; d=google.com; s=arc-20160816; b=jeweBEWD6ImuxwCDRBWVJpbspF8WW2dyUPu7ms4smi6+gnGC84rqyZ3M+HDVzwSA3N omuhM85nanS07rbkYW7/yapK2N6j0gkuXpcsKo2QO7CiER/4FOu+y4s1aAxj4UQVPLAP 8k4s0PDcH8+xPYFwaxcnG1Bw+gD1n1RftaiU5hiouadTsPgqHlzGqWaw+2GmLgWgaB6M PeCsvu4zTgcBH+x+rN+hZJveiPb9bcDpmDphDW+GbGiv/Npp+B4XW6nOjD7aRxScYmXj 0i/fz9qjlyTw0ExzQXDfh1CQwRBRYWdzRLYQUggCEfUxWREJbRdOmogurQAxud8gyflC yBmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:subject:message-id:date:from :in-reply-to:references; bh=xZsWiz7EIHLLbKD2FcBwMgkmLuu7RysGL6gJwqNKhdk=; b=fVBycFpsDmyOIkhYxbqloVgX2C/yJJ7ymEYTccpsGqy6m5Kc4jvSc8Q0plRbr8OIkk xdaavSF2BcU0ZPlD0d+R4v1ya1++ma3saNBgY43f3+ex6uVXE3g3/NpFZ1RflpGAaFo1 5VSP3EscgRfakLn0t4avuWf8jH3n44IQ/W0z96XQ8mRSCjsDc8D5CASOluwkzS4JRljJ B3In00GeJcQcwQ1ZtULGRJN5h/GxaXHR0Ty3OOieIyCZ3oT8HkUM77nypjII485/TLQ5 yFsu0lEbkR2GyZJqWpwRTElIeL/kxeYKSoNwbqspbyFVDTLZ2ri9pSvrAnhr9mqmuTb5 8Zkg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ucalgary.ca dkim=pass dkdomain=ucalgary.ca dmarc=pass fromdomain=ucalgary.ca); spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucalgary.ca Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q20-20020a63d614000000b003f250fc5e17si1449691pgg.793.2022.05.17.23.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 23:09:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ucalgary.ca dkim=pass dkdomain=ucalgary.ca dmarc=pass fromdomain=ucalgary.ca); spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucalgary.ca Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71FD9C8BD0; Tue, 17 May 2022 23:08:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230503AbiERGIy (ORCPT + 71 others); Wed, 18 May 2022 02:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbiERGIw (ORCPT ); Wed, 18 May 2022 02:08:52 -0400 Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-qb1can01on2041.outbound.protection.outlook.com [40.107.66.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F56EC6E65 for ; Tue, 17 May 2022 23:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XTYzgn4Fjcj5idKAGVBoRF5njDPfaJEI8uT9Btzvxy0NdURIjE/s7VH1hY3r1Ctl5wY+jCvrjQYbqDi7l5M0OKS8BVy8SRfXT86K/cay+ovm/Bar91YKqt8jv8AW4/OCRY+nVGk79E8JIS0znXBgNpG+92BOQ76FDn5LJ2VfLD2B5SaB5tKIRQj8/hGplYmTa0Hk27SF5bww2sDNJcPIWUXj8p9T77iEQ/dopSO4ibFx9NIsHL0/2rLIXd+0kG1JI7MJeqUrEsD/Pd3kWSNJA05WrtVVcK4xuyefcUFFaLBQ1kzhn+IGB5MdAFPoRNst52QHAdJyVArz9fsMv8o17Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xZsWiz7EIHLLbKD2FcBwMgkmLuu7RysGL6gJwqNKhdk=; b=EmgXSVkr5MQLpj51cs+AzAfTQgHxPv8xQacWA86WS2gSr1c4q6pEgiMXy7JLsku1MELjZoEoaQeXZ8wFxAMnQ77EqS/VDY5EjFFXEBMcSmAKwPnyfD3c0FEwoDs66cZr4PfrJjhtXpJx3pwNugPFMtMA2TUIeV8Jnx1LU53HT864LhGAhyhhIAFkO6gCfNeJqT8CdiOe7dTzkDiOKSJWBysp23rP8NFK06DcZnsZv8WzM650Ne8p0vuNDkMS0VpU2xqikuZkVxG+bOiXDIdgqxcnpnjauUTfHU44VThjYSgbWqpx35vOJf+TPvLPDSYGBj9oedFKVDFuH1mMXdbY5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucalgary.ca; dmarc=pass action=none header.from=ucalgary.ca; dkim=pass header.d=ucalgary.ca; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ucalgary.ca; Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) by YT2PR01MB5888.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:58::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Wed, 18 May 2022 06:08:44 +0000 Received: from YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::a17b:bb51:f663:e98f]) by YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM ([fe80::a17b:bb51:f663:e98f%4]) with mapi id 15.20.5250.018; Wed, 18 May 2022 06:08:44 +0000 X-Gm-Message-State: AOAM532k3LNi8g4QMWWeJKVQ2Dzowv5QIGwprBHEwXtmOzXm3F0r6P5U UZxlAZTln/e9XGoRNzRxI6wYSyMScL+hvLjiQ+E= X-Received: by 2002:a05:622a:6184:b0:2f1:e213:9c7 with SMTP id hh4-20020a05622a618400b002f1e21309c7mr22686993qtb.467.1652854122353; Tue, 17 May 2022 23:08:42 -0700 (PDT) References: <20220512195319.14635-1-wlooi@ucalgary.ca> <20220512195319.14635-3-wlooi@ucalgary.ca> <69feb893-d73a-46e5-fbe6-2f49e091c625@quicinc.com> In-Reply-To: <69feb893-d73a-46e5-fbe6-2f49e091c625@quicinc.com> From: Wenli Looi Date: Tue, 17 May 2022 23:08:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/9] ath9k: basic support for QCN550x To: Jeff Johnson Cc: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Kalle Valo , linux-wireless@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-ClientProxiedBy: BL0PR02CA0051.namprd02.prod.outlook.com (2603:10b6:207:3d::28) To YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4a::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42e5ac18-1f32-415c-ca25-08da3894dce7 X-MS-TrafficTypeDiagnostic: YT2PR01MB5888:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vkgja1MoRXKq7Rip/ElNLLUoAQ0vON5YqgRSliqRNgwaIMpKWNd7ZzKIHVI5O1cO1B8aII0bJmFXByFA3UVPeaIbLrVVfIW113wzIjlgaJ2PChdR/1kqwdgTR1t9JBBhqYxmMH1gfD8TbY3bCz6i/dTf3uKtcu0SJV9xaiV6bPmQhVWFaM6mf9oMpBUrQPh0lgW7bb2gLZB/lRoNarGOH2iMhgQU9OMYjb5884WyJ/v9YUreDxH6IO+55/NGXMzk/7/9wn9jemgU1aOWUP/Ce9qh7ns6NG3HKW745+QLWc7cNCQf7GmzJCBFSpnsmCWjKuj7t+F5oM5BuX0VSUXCfPz9hIQc901hIPanvMTYOmAHt2NogfU9DLMM33hJbsYswIDJ+OxOS9Rdw2Ucb66312cGYE4ajvCuBnqRzdnAEbJI/c1stgHTucKcFzJHtrh6npU45JoemTtYe/3fAfz3UQBjJgEVvLPj0G2gkVvj3eGLGapl0g+ebPoDAiqpfhlc0LZYcDetRJ2cRyHDkAIH5wBee4ecoD1poG5PzdNwdnD9GZo/UobGPOb8eDz8O99vxIK8mlQr5tJhP9NJ8Dgt0EJBseDW0RC5g7+/Zfg08OFS38EMLhiUicnp+Pftu2mT+t24caYHHrG93jDkUeDEi1aB6YV6t+wufNphtWStV+FyAcxAfC6WbsGFyNpVVwOYipDx+m5CbCAm8wbEdSG9Tq9mSRfpBI52Q7Wf4a1uGieghlMp5XqnVXCJSG7dVIHrRHfGA4uVT5dJYEkaPo8yjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(6862004)(54906003)(4326008)(186003)(38100700002)(38350700002)(26005)(786003)(86362001)(9686003)(55236004)(6512007)(6666004)(52116002)(53546011)(5660300002)(966005)(6506007)(2906002)(6486002)(316002)(8936002)(66476007)(66946007)(66556008)(508600001)(55446002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dFVObnNHYXBPZ2E1VXc2SCtPTThTYktWRG9HZFAvcGdPdHU2RnEzSHR6emI1?= =?utf-8?B?ZWp0cEJqTlpQOFVRRXRWTWlHalR1cG1ORmlMcEloalQ3blFZZGJKQVlNSy9n?= =?utf-8?B?MkcyVkdIZk5rMHJVVzJ2M0xwTnE3ZUNzNWdJV2llYkhYbmN4TjY1KzFuSXZ5?= =?utf-8?B?TjBTSDVqcjZ6WU1zbjQzU3pwMEVpVVlGRE1wc216YUgva0lKWXlXRW9VRFNq?= =?utf-8?B?cEZWWHVPeWwyYXlNY0crL2JhcFFoWXRpbHlsaDJmYitpaThMNHpLNzNvSDVk?= =?utf-8?B?b050STNGaFJJMDE1VE5ybXBVeVZ5cXQvNDVETUhrSjFBUlV5RWRCTXByQmlF?= =?utf-8?B?UDN0MnZNUllpMHJNNzU1bkNTQkVGMVE5bkNxUGF0c1pDSkhGSzVHZ2trTjlO?= =?utf-8?B?dDJmakE2TTFObnpMV0JBejlIMjVNOXYyMHhzYnpqZ0htUHBSZDBqaTMyT0Vn?= =?utf-8?B?UjlWak0yN0hMZDhG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k1UkU1UTh4?= =?utf-8?B?WVlUamM2RmJuYmwzc2RLN2ltckMrWTVRZ3orRVJtaWw0TGhvWUE2QT09?= X-OriginatorOrg: ucalgary.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 42e5ac18-1f32-415c-ca25-08da3894dce7 X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB3302.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 06:08:44.1495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c609a0ec-a5e3-4631-9686-192280bd9151 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vduTGwqQEJEIzSO29ZXg/UqCuedzZVW4nidsdypxL3ihLP1d3pmQ/hYPw5mJgYxRHT0LtVdVBJGbWkohei0Lcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT2PR01MB5888 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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). > > -#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.