public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set
@ 2021-05-20 13:42 Wei Yongjun
  2021-05-20 13:50 ` Jon Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2021-05-20 13:42 UTC (permalink / raw)
  To: weiyongjun1, Lorenzo Pieralisi, Bjorn Helgaas, Thierry Reding,
	Jonathan Hunter, Philipp Zabel, Liam Girdwood, Mark Brown,
	Rob Herring, Vidya Sagar, Jingoo Han, Dinghao Liu,
	Greg Kroah-Hartman
  Cc: linux-pci, linux-tegra, kernel-janitors, Hulk Robot

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(+)

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;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set
  2021-05-20 13:42 [PATCH -next] PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set Wei Yongjun
@ 2021-05-20 13:50 ` Jon Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2021-05-20 13:50 UTC (permalink / raw)
  To: Wei Yongjun, Lorenzo Pieralisi, Bjorn Helgaas, Thierry Reding,
	Philipp Zabel, Liam Girdwood, Mark Brown, Rob Herring,
	Vidya Sagar, Jingoo Han, Dinghao Liu, Greg Kroah-Hartman
  Cc: linux-pci, linux-tegra, kernel-janitors, Hulk Robot


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/

-- 
nvpublic

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-20 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-20 13:42 [PATCH -next] PCI: tegra: Fix build warnings when CONFIG_PCIEASPM is not set Wei Yongjun
2021-05-20 13:50 ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox