[PATCH -next] pci: Fix -Wunused-function warnings for pci_ltr_*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux