From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 457CBC433EF for ; Fri, 25 Feb 2022 15:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=q9+KconhnvRF5p9dz7KLYhA/6o7m04b3xj/NnacE758=; b=0ccCMnFC7X3HGv gj8zvei/S08Ns9gcZlXiYx6AbsrzBaVJgk7bXLHfiAD7iTMOS4h23GSoIhPXRIb79l5SfhB+T8jXY izYRUdwv36EVZSqk3RKdOt6G/d/zxWE4UuB8uH2ITmpOSISN7GgZBJbHRxcldmSVjmFUX3XRhtZtl LcwJlEd9weDzVott5JdXtNRVxn8Mz2aQcVN6ycyhKE+e22L1CaDh4uIuaFSeBrN0nJBXzfwJcu/Vs IhK/mOFw9BuZq+d8ADxDlTKoFrL65vBDNG08vhqoPmzsQh0Hz5jP/8AkbKAI9LSTLMudTW36NijpN mTjVHpr/7YBNbW96isnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNcfz-005dum-Uy; Fri, 25 Feb 2022 15:38:36 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNcfQ-005dgk-3R for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 15:38:01 +0000 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 E65AC6190C; 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-Disposition: inline In-Reply-To: <20220225122451.fa2fiyzohwme2d66@pali> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_073800_233119_0D2987B1 X-CRM114-Status: GOOD ( 24.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 25, 2022 at 01:24:51PM +0100, Pali Roh=E1r wrote: > On Thursday 24 February 2022 14:28:43 Bjorn Helgaas wrote: > > On Tue, Feb 22, 2022 at 05:31:54PM +0100, Pali Roh=E1r 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=E1r > > > Signed-off-by: Marek Beh=FAn > > > --- > > > 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_r= egs.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 shif= t */ > > = > > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel