public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
To: helgaas@kernel.org
Cc: "Bolarinwa O. Saheed" <refactormyself@gmail.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	hch@lst.de
Subject: [RFC PATCH v5 1/4] PCI/ASPM: Move pci_function_0() upward
Date: Fri, 19 Nov 2021 20:37:29 +0100	[thread overview]
Message-ID: <20211119193732.12343-2-refactormyself@gmail.com> (raw)
In-Reply-To: <20211119193732.12343-1-refactormyself@gmail.com>

From: "Bolarinwa O. Saheed" <refactormyself@gmail.com>

To call pci_function_0() directly from other functions,
move its definition upward to a more accessible location.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bolarinwa O. Saheed <refactormyself@gmail.com>
---
 drivers/pci/pcie/aspm.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 52c74682601a..6f128b654730 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -105,6 +105,20 @@ static const char *policy_str[] = {
 
 #define LINK_RETRAIN_TIMEOUT HZ
 
+/*
+ * The L1 PM substate capability is only implemented in function 0 in a
+ * multi function device.
+ */
+static struct pci_dev *pci_function_0(struct pci_bus *linkbus)
+{
+	struct pci_dev *child;
+
+	list_for_each_entry(child, &linkbus->devices, bus_list)
+		if (PCI_FUNC(child->devfn) == 0)
+			return child;
+	return NULL;
+}
+
 static int policy_to_aspm_state(struct pcie_link_state *link)
 {
 	switch (aspm_policy) {
@@ -423,20 +437,6 @@ static void pcie_aspm_check_latency(struct pci_dev *endpoint)
 	}
 }
 
-/*
- * The L1 PM substate capability is only implemented in function 0 in a
- * multi function device.
- */
-static struct pci_dev *pci_function_0(struct pci_bus *linkbus)
-{
-	struct pci_dev *child;
-
-	list_for_each_entry(child, &linkbus->devices, bus_list)
-		if (PCI_FUNC(child->devfn) == 0)
-			return child;
-	return NULL;
-}
-
 static void pci_clear_and_set_dword(struct pci_dev *pdev, int pos,
 				    u32 clear, u32 set)
 {
-- 
2.20.1


  reply	other threads:[~2021-11-19 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 19:37 [RFC PATCH v5 0/4] PCI/ASPM: Remove struct aspm_latency Saheed O. Bolarinwa
2021-11-19 19:37 ` Saheed O. Bolarinwa [this message]
2021-11-19 19:37 ` [RFC PATCH v5 2/4] PCI/ASPM: Do not cache link latencies Saheed O. Bolarinwa
2021-11-19 19:37 ` [RFC PATCH v5 3/4] PCI/ASPM: Remove struct pcie_link_state.acceptable Saheed O. Bolarinwa
2021-11-19 19:37 ` [RFC PATCH v5 4/4] PCI/ASPM: Remove struct aspm_latency Saheed O. Bolarinwa
2021-11-19 22:51 ` [RFC PATCH v5 0/4] " Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119193732.12343-2-refactormyself@gmail.com \
    --to=refactormyself@gmail.com \
    --cc=hch@lst.de \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox