Message ID | 20210520134209.1667244-1-weiyongjun1@huawei.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [-next] PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set | expand |
On 20/05/2021 14:42, Wei Yongjun wrote: > 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@huawei.com> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Thanks but this has already been reported and there is a fix available [0]. Jon [0] https://patchwork.ozlabs.org/project/linux-tegra/patch/20210520090123.11814-1-jonathanh@nvidia.com/
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;
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@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> --- drivers/pci/controller/dwc/pcie-tegra194.c | 2 ++ 1 file changed, 2 insertions(+)