From patchwork Thu Oct 26 12:19:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13437542 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 4C6ADC25B48 for ; Thu, 26 Oct 2023 12:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235002AbjJZMTj (ORCPT ); Thu, 26 Oct 2023 08:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234896AbjJZMTi (ORCPT ); Thu, 26 Oct 2023 08:19:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 309A4B9; Thu, 26 Oct 2023 05:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698322776; x=1729858776; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=p+Gb2snRIkAb2gO0jCgy4vPKw4QvuWg0X9Z+93KecFo=; b=fQ+ZZTTQnEOa5jU+7y8nGh0eo3MZVlZiPd+W8XaaY5G4YQEQTyQGCR30 TB3nGW1J0lCafhLzlJFJ1a70hIef/37o3DP0yuCXT9mQ7XnnBhAuVZ1Vs Jxu5gTYiq+ld8zjvnEzOIBIOMpPZK5arirKnBrVI1ws27v3BPAm3Waf91 EyMAVQe83NcCznNG/K9oI6eYyWpOHQHnx2pS4qLTnQG6p7Do8eJ0A1TIr ve9qetSdLuASy9+TiHSqemCdKV7v8t2q2faAniRFz1ncWgc59eqw+OojZ qy0t6ZpL38j7mmHMkUPymIXdJZ1VCwQHPKNRVa+qw/gXxo+B/mhlHISD6 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="390390969" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="390390969" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 05:19:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="1090589448" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="1090589448" Received: from ialvarez-mobl.ger.corp.intel.com (HELO localhost) ([10.252.33.120]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 05:19:33 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 1/2] PCI/ASPM: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() Date: Thu, 26 Oct 2023 15:19:23 +0300 Message-Id: <20231026121924.2164-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When set parameter is 0, pcie_capability_clear_and_set_word() can be turned into pcie_capability_clear_word() which makes the intent of the code slightly more obvious. Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aspm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 1bf630059264..3b0508b47472 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -689,10 +689,10 @@ static void pcie_config_aspm_l1ss(struct pcie_link_state *link, u32 state) * in pcie_config_aspm_link(). */ if (enable_req & (ASPM_STATE_L1_1 | ASPM_STATE_L1_2)) { - pcie_capability_clear_and_set_word(child, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPM_L1, 0); - pcie_capability_clear_and_set_word(parent, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPM_L1, 0); + pcie_capability_clear_word(child, PCI_EXP_LNKCTL, + PCI_EXP_LNKCTL_ASPM_L1); + pcie_capability_clear_word(parent, PCI_EXP_LNKCTL, + PCI_EXP_LNKCTL_ASPM_L1); } val = 0; From patchwork Thu Oct 26 12:19:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13437543 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 19D31C25B48 for ; Thu, 26 Oct 2023 12:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234902AbjJZMTt (ORCPT ); Thu, 26 Oct 2023 08:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235056AbjJZMTr (ORCPT ); Thu, 26 Oct 2023 08:19:47 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F538D56; Thu, 26 Oct 2023 05:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698322785; x=1729858785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sDhZf15BV04eSn2K5282do0xuIjqvRY33xZ0d2grIHo=; b=L2e01mq+ShnoayCH1Cd6xJBwqHbR5u3uzB5T+tgeBHocPm642b7CPDDK CoFf9mPYkKbd5nKAK2nKApUmInJi/4n0qfPcXoQiMTOU8dTWSZYlGhkFV 9H5i8OtKPC4C4qG5vHVTeRdR3EIu5JFewrXZexgq58NmtturQ4yhcIpNZ 8iP0f1OttgOi7/HJxNK82Hc2g/x7zdWAr+A4aB5LfoK345Wbjgw2EmBW4 aXi5aPLaO7wFWAQpgrL3VUrYRCYGJKMH65yH5jv+uYcM8WTjr7L4QVzOH rLDQCWpZj20baydmUNcq12SKOLg9ez8X4llSYdPNYd1EfVhjEj11XX8lv w==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="390390980" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="390390980" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 05:19:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="1090589468" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="1090589468" Received: from ialvarez-mobl.ger.corp.intel.com (HELO localhost) ([10.252.33.120]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 05:19:42 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 2/2] PCI: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() Date: Thu, 26 Oct 2023 15:19:24 +0300 Message-Id: <20231026121924.2164-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231026121924.2164-1-ilpo.jarvinen@linux.intel.com> References: <20231026121924.2164-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When set parameter is 0, pcie_capability_clear_and_set_word() can be turned into pcie_capability_clear_word() which makes the intent of the code slightly more obvious. Signed-off-by: Ilpo Järvinen --- drivers/pci/quirks.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index eeec1d6f9023..180d01141e50 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -4553,9 +4553,9 @@ static void quirk_disable_root_port_attributes(struct pci_dev *pdev) pci_info(root_port, "Disabling No Snoop/Relaxed Ordering Attributes to avoid PCIe Completion erratum in %s\n", dev_name(&pdev->dev)); - pcie_capability_clear_and_set_word(root_port, PCI_EXP_DEVCTL, - PCI_EXP_DEVCTL_RELAX_EN | - PCI_EXP_DEVCTL_NOSNOOP_EN, 0); + pcie_capability_clear_word(root_port, PCI_EXP_DEVCTL, + PCI_EXP_DEVCTL_RELAX_EN | + PCI_EXP_DEVCTL_NOSNOOP_EN); } /*