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 EBA4AC433EF for ; Thu, 24 Feb 2022 20:30:01 +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=6dld92TfdmkJeA9eLK7u447J9y2IwMSHKeYDr6KKU2s=; b=bAgDOGqO9MI3BS s88MbT8rT7NNuuT6sBFcGvh4tvW2Se8x55GUfjqzR0vhZcQOuKZjUPMHk5ULAO4bchAPv7EfmNEbJ z2WJpcihaRDOrfgMRagPecSnMaelV4A7mOgtLWjPbfhhZPZsWyEneY57lP3Q/7J8WcTX5m7bz4C9H sozpL1JjxYwMaExWW3rPA+46NzJW/yEk06F2mzMqSb657sj8+OpCjOaLnVy7DFmMnvJH8hwMD669o TMVnrbzU7DccYLB1jthQeDvsx6Gm57vq4qa9teew0oee07BvMn5cxOYtmUczRnKrCiqeiGGZoeMpN 4nP5AtVB6JJw20Z9IUeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNKjM-002Lpt-OY; Thu, 24 Feb 2022 20:28:52 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNKjI-002Loa-22 for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 20:28:50 +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 ams.source.kernel.org (Postfix) with ESMTPS id B0387B8248D; Thu, 24 Feb 2022 20:28:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2119AC340F1; Thu, 24 Feb 2022 20:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645734525; bh=RLYzKyVka004GdRLmz5m3+pr/oqevTj0Ra7GDwW7+3M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=BoC86fN9VCcEubBtJh+aWU24Jk79knwejh0PrVjkOdo6b58/NR56leKwFZ8tCoblf /WCBiS2PhdnP+f0eomr4p4G5FJ7C9dP+icez54zJWI023xtrOXGxi15IUkxmpJDocs +yrUQy0BC1pNBcNeVN7yBV73WJ95gKN9Y78tT4/1q68qe+f3MjFK7rVBkmgrpt5rhE S2MEz00XXCCboupMNJVrlg7n+32FU0iAxeZB9VxTfJPCR+5QQV+EnSh6zuP3atulaL nhsHaEdeWBHqm6vNfsmaF2sMuyiGGzffarzwsNJoXU/ah6Y9uzKnf/a5GmWNJIwQgR FsEM7CysanBPw== Date: Thu, 24 Feb 2022 14:28:43 -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: <20220224202843.GA291544@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220222163158.1666-3-pali@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220224_122848_277662_E0549400 X-CRM114-Status: GOOD ( 16.40 ) 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 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_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. At first I didn't really like them, but they do remove the need for adding _SHIFT macros that have to be manually related to the other. > #define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */ > +#define PCI_EXP_SLTCAP_SPLS_SHIFT 15 /* Slot Power Limit Scale shift */ > #define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Pr= esent */ > #define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support = */ > #define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ > +#define PCI_EXP_SLTCAP_PSN_SHIFT 19 /* Physical Slot Number shift */ > #define PCI_EXP_SLTCTL 0x18 /* Slot Control */ > #define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */ > #define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */ > -- = > 2.20.1 > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel