From patchwork Tue Oct 10 20:44:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13416142 X-Patchwork-Delegate: bhelgaas@google.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B91FFCD98C2 for ; Tue, 10 Oct 2023 20:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234709AbjJJUpL (ORCPT ); Tue, 10 Oct 2023 16:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234228AbjJJUpC (ORCPT ); Tue, 10 Oct 2023 16:45:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF5999; Tue, 10 Oct 2023 13:45:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1621C433C8; Tue, 10 Oct 2023 20:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696970700; bh=SgJRtupS7nAWYb0BB4CUnQ7/s6tkDFcfcPN1MGYpdEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DMAdtbkfo0lFfisjm0xLwJhX+R52fe8k7WECE9pmsA7xM3yYuTx6kE4Ox1n5qq2fF 0MoMu8wmTgTbx6b+gOg4DLQdAKadVkhaRvJ7T9H8XlMPcy3COgUh8X+4QQPKQoGZ5d cSwmx/IrvM3TfUMYX6ydn4VK53tuLGYsk70KpB42F9dXJJKmGL2G9EpUpHdz5ne2Rq 88MX9zIiAndMbxwm9RtoKbQlDKXxJtGR6HQ9Gq95ShgoxWL44sTHPK1kgUJD2ZW7Cq m+D/wkYmUbb2f972cZEIGm2JfWT5H9O/SCaGmrW0e6SiSVR3wO4HovWmFolu1bquNU 3oFM+qUicDxqA== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Jonathan Cameron , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 07/10] PCI/PME: Use FIELD_GET() Date: Tue, 10 Oct 2023 15:44:33 -0500 Message-Id: <20231010204436.1000644-8-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010204436.1000644-1-helgaas@kernel.org> References: <20231010204436.1000644-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Bjorn Helgaas Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Ilpo Järvinen --- drivers/pci/pcie/pme.c | 4 +++- include/uapi/linux/pci_regs.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index ef8ce436ead9..a2daebd9806c 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c @@ -9,6 +9,7 @@ #define dev_fmt(fmt) "PME: " fmt +#include #include #include #include @@ -235,7 +236,8 @@ static void pcie_pme_work_fn(struct work_struct *work) pcie_clear_root_pme_status(port); spin_unlock_irq(&data->lock); - pcie_pme_handle_request(port, rtsta & 0xffff); + pcie_pme_handle_request(port, + FIELD_GET(PCI_EXP_RTSTA_PME_RQ_ID, rtsta)); spin_lock_irq(&data->lock); continue; diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index e97a06b50f95..9fb8a69241f4 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -637,6 +637,7 @@ #define PCI_EXP_RTCAP 0x1e /* Root Capabilities */ #define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */ #define PCI_EXP_RTSTA 0x20 /* Root Status */ +#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */ #define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */ #define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */ /*