[PATCH -next] PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set

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

 



Fix build warning when CONFIG_PCIEASPM is not set:

drivers/pci/controller/dwc/pcie-tegra194.c:259:18: warning:
 'event_cntr_data_offset' defined but not used [-Wunused-const-variable=]
  259 | static const u32 event_cntr_data_offset[] = {
      |                  ^~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/dwc/pcie-tegra194.c:250:18: warning:
 'event_cntr_ctrl_offset' defined but not used [-Wunused-const-variable=]
  250 | static const u32 event_cntr_ctrl_offset[] = {
      |                  ^~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/dwc/pcie-tegra194.c:243:27: warning:
 'pcie_gen_freq' defined but not used [-Wunused-const-variable=]
  243 | static const unsigned int pcie_gen_freq[] = {
      |                           ^~~~~~~~~~~~~

Fix it by only define then when CONFIG_PCIEASPM is set.

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
---
 drivers/pci/controller/dwc/pcie-tegra194.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index bafd2c6ab3c2..b80dd071e90d 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -240,6 +240,7 @@
 #define EP_STATE_DISABLED	0
 #define EP_STATE_ENABLED	1
 
+#if defined(CONFIG_PCIEASPM)
 static const unsigned int pcie_gen_freq[] = {
 	GEN1_CORE_CLK_FREQ,
 	GEN2_CORE_CLK_FREQ,
@@ -264,6 +265,7 @@ static const u32 event_cntr_data_offset[] = {
 	0x1c8,
 	0x1dc
 };
+#endif
 
 struct tegra_pcie_dw {
 	struct device *dev;




[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