linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@redhat.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Puranjay Mohan <puranjay12@gmail.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH -next] pci: Fix -Wunused-function warnings for pci_ltr_*
Date: Thu,  1 Oct 2020 09:28:49 -0400	[thread overview]
Message-ID: <20201001132850.7630-1-cai@redhat.com> (raw)

When CONFIG_PCIEASPM=n,

drivers/pci/pci.c:3098:12: warning: 'pci_ltr_encode' defined but not used [-Wunused-function]
 static u16 pci_ltr_encode(u64 val)
            ^~~~~~~~~~~~~~
drivers/pci/pci.c:3076:12: warning: 'pci_ltr_decode' defined but not used [-Wunused-function]
 static u64 pci_ltr_decode(u16 latency)
            ^~~~~~~~~~~~~~

Fixes: 5ccf2a6e483f ("PCI/ASPM: Add support for LTR _DSM")
Signed-off-by: Qian Cai <cai@redhat.com>
---
 drivers/pci/pci.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index db8feb2033e7..e96e5933b371 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3069,6 +3069,7 @@ void pci_pm_init(struct pci_dev *dev)
 		dev->imm_ready = 1;
 }
 
+#ifdef CONFIG_PCIEASPM
 /**
  * pci_ltr_decode - Decode the latency to a value in ns
  * @latency: latency register value according to PCIe r5.0, sec 6.18, 7.8.2
@@ -3113,7 +3114,6 @@ static u16 pci_ltr_encode(u64 val)
  */
 void pci_ltr_init(struct pci_dev *dev)
 {
-#ifdef CONFIG_PCIEASPM
 	int ltr;
 	struct pci_dev *bridge;
 	u64 snoop = 0, nosnoop = 0;
@@ -3150,9 +3150,15 @@ void pci_ltr_init(struct pci_dev *dev)
 		pci_write_config_word(dev, ltr + PCI_LTR_MAX_NOSNOOP_LAT,
 				      nosnoop_enc);
 	}
-#endif
 }
 
+#else
+void pci_ltr_init(struct pci_dev *dev)
+{
+}
+
+#endif
+
 static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop)
 {
 	unsigned long flags = IORESOURCE_PCI_FIXED | IORESOURCE_PCI_EA_BEI;
-- 
2.28.0


             reply	other threads:[~2020-10-01 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 13:28 Qian Cai [this message]
2020-10-01 17:01 ` [PATCH -next] pci: Fix -Wunused-function warnings for pci_ltr_* 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=20201001132850.7630-1-cai@redhat.com \
    --to=cai@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=puranjay12@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).