Skip to contentSkip to conversation

PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set

PATCH In review Wei Yongjun 2 participants 2 messages May 20, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set

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.

---
 drivers/pci/controller/dwc/pcie-tegra194.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/controller/dwc/pcie-tegra194.c +2 -0
index bafd2c6ab3c2..b80dd071e90d 100644
@@ -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;
maintainer
#1 lore raw
Quoted 15 lines · Wei Yongjun

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[] = {
      |                           ^~~~~~~~~~~~~
Quoted 4 lines

Fix it by only define then when CONFIG_PCIEASPM is set.

Thanks but this has already been reported and there is a fix available [0].

Jon

[0]
https://patchwork.ozlabs.org/project/linux-tegra/patch/[email protected]/

Signature · 1 line
nvpublic