Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp391068pxm; Fri, 25 Feb 2022 09:59:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2QBJDUDEP32E+zeFdQSKmipgGGdSWoiAR4Blq2NqX1YdogqnrntH1af1IW3ycLaV0+Ewd X-Received: by 2002:a17:906:2ecd:b0:6d3:d7c9:8fa4 with SMTP id s13-20020a1709062ecd00b006d3d7c98fa4mr6907232eji.144.1645811959209; Fri, 25 Feb 2022 09:59:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645811959; cv=none; d=google.com; s=arc-20160816; b=nyXZzXs4qQwULW54oQc6ZcO62KhoExtg2R+MW8yszye9EWflYAQIObUwWE9rFlkCxr 2Wo0SjyHeQRW9WGDLJ8/Z6/7dzECtDtd6QTybYWLAdQ1iuIHQMdY5XrP6FyE9c8zucge VHLhqJVktVN9x+on8jfxH10N7Jji1H8lk13s87k3+qyo1ZKwOiNyjjuS1xfNGUV5EgVO 8UZtjkctGocZStov00Hrq0zXXRN0xoIHzIF6N56gwvapUeiIf6qI163AEeQ/tA9dtG3x eCzgomQcleFg7aimhTfLAbNKwIAkq9TUCrTa3fDHow/sknsRvGvwaWCsn55mgD2wPm8G aA2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=klTCbJoW58oxlOl3lHnJr5OJYV+EjKUFmQsbQX8D2eM=; b=N51I52LS8klJbF4iQbyfac1T7zNciEblvXGh2Ig8pH8sYEgqj/3msu5MJ8FO8VJKjQ 8vWMK82kfPD69a77L3WgxQODvIbG9XS0WIE3qBXQxGmxenq+rJP9Xj/v9tuv9QO37ssi zE4uDloILYq/J1f+KFIZoNSMdlTRe7tI8HwCZt4sCnmp15cqDN7H0gsECCc48w/CaAaD GXI3Mu4kCpfMkdujuM/V566q/d4qZE5TUNXX8UsAi/hJikchsRCm1z5FQDmWCwjDRCSh FAW4BJeSQWFXEVSCjdvqeZXrluy2U57ImupJBE0J7PH+Un6SF2+Z4daY736FfRf714Q0 A1wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CCnRtCJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a170906938b00b006d09ebc28edsi1839424ejx.902.2022.02.25.09.58.56; Fri, 25 Feb 2022 09:59:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CCnRtCJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242202AbiBYPid (ORCPT + 99 others); Fri, 25 Feb 2022 10:38:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239396AbiBYPib (ORCPT ); Fri, 25 Feb 2022 10:38:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6898714F2A6; Fri, 25 Feb 2022 07:37:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E6546618C5; Fri, 25 Feb 2022 15:37:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15D1DC340F0; Fri, 25 Feb 2022 15:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645803478; bh=g98zliAtM2Tc6v3mwYJ14NN8JaWLKdHFUA4VftrTn6U=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=CCnRtCJaxgV9HmJFSyPj+jajT4/2v2E2/2sbiK+wTwgAkK9VYqaVVXruNGv6odZfw V+7GDK6lCMcPITFVfTKgSh/EC9a8wY25tVbdYm9L2THSX/lyca/vuOdwzwCDH2vl8z zRxEkbooPjGmdxd8HCgqhg+/8rHocpnmebG7Ewy3VTl3JzOkzpSCmWK2R+zRg1Du3U 23w7MiJzog2ZfZlfjnzyyTLzfKKC3RVVO45SIVo6dnNiiuFXhbPdwVKX2vB1gbcZJE KpRniDbA6WjyWfbq788WReK252QrTmlFNqVY17ug/5j1DHmfi0t3nlOwvJ9XLhheeC klJHvkJTwC3+Q== Date: Fri, 25 Feb 2022 09:37:56 -0600 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Lorenzo Pieralisi , Bjorn Helgaas , Rob Herring , Andrew Lunn , Thomas Petazzoni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Marek =?iso-8859-1?Q?Beh=FAn?= , Russell King , Gregory Clement , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] PCI: Add PCI_EXP_SLTCAP_*_SHIFT macros Message-ID: <20220225153756.GA358517@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220225122451.fa2fiyzohwme2d66@pali> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 01:24:51PM +0100, Pali Roh?r wrote: > On Thursday 24 February 2022 14:28:43 Bjorn Helgaas wrote: > > On Tue, Feb 22, 2022 at 05:31:54PM +0100, Pali Roh?r wrote: > > > These macros allows to easily compose and extract Slot Power Limit and > > > Physical Slot Number values from Slot Capability Register. > > > > > > Signed-off-by: Pali Roh?r > > > Signed-off-by: Marek Beh?n > > > --- > > > include/uapi/linux/pci_regs.h | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > > > index 108f8523fa04..3fc9a4cac630 100644 > > > --- a/include/uapi/linux/pci_regs.h > > > +++ b/include/uapi/linux/pci_regs.h > > > @@ -591,10 +591,13 @@ > > > #define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */ > > > #define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */ > > > #define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */ > > > +#define PCI_EXP_SLTCAP_SPLV_SHIFT 7 /* Slot Power Limit Value shift */ > > > > Is there a way to use FIELD_PREP() and FIELD_GET() instead? It seems > > like that's what the cool kids are doing now. > > This is possible too. > > I have proposed a patch with _SHIFT macros as this is the way how are > other macros in this file defined and used. Yes, it's a mix. For some recent additions, I've resisted adding the _SHIFT macros on the theory that they clutter the file, they never change, and the main point of the #defines is readability and so grep/tags/etc can find things. There are a *few* users of FIELD_PREP() and FIELD_GET(): git grep -E "FIELD_(GET|PREP)\(PCI_EXP" and I'm inclined to go that direction in the future. What do you think? Bjorn