Skip to contentSkip to conversation

FPGA Manager address unused variable warnings

PATCH In review Moritz Fischer 3 participants 8 messages Jul 2, 2021 – Jul 18, 2021

Subsystems (2)
lore
Share & tools
lore

Moritz Fischer

author maintainer
#0 lore raw

cover FPGA Manager address unused variable warnings

This patchset addresses a handful of warnings as result of_match_ids being not properly wrapped in #ifdef CONFIG_OF.

Moritz Fischer (4):
fpga: altera-freeze-bridge: Address warning about unused variable
fpga: xiilnx-spi: Address warning about unused variable
fpga: xilinx-pr-decoupler: Address warning about unused variable
fpga: zynqmp-fpga: Address warning about unused variable

 drivers/fpga/altera-freeze-bridge.c | 2 ++
 drivers/fpga/xilinx-pr-decoupler.c  | 2 ++
 drivers/fpga/xilinx-spi.c           | 2 ++
 drivers/fpga/zynqmp-fpga.c          | 3 ++-
 4 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.32.0
author maintainer
#1 lore raw

PATCH 1/4 fpga: altera-freeze-bridge: Address warning about unused variable

warning: unused variable 'altera_freeze_br_of_match'
[-Wunused-const-variable]
static const struct of_device_id altera_freeze_br_of_match[] = {

Fixes ca24a648f535 ("fpga: add altera freeze bridge support")
Cc Tom Rix <[email protected]>
---
 drivers/fpga/altera-freeze-bridge.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/fpga/altera-freeze-bridge.c +2 -0
index dd58c4aea92e..7d22a44d652e 100644
@@ -198,11 +198,13 @@ static const struct fpga_bridge_ops altera_freeze_br_br_ops = {
 	.enable_show = altera_freeze_br_enable_show,
 };
 
+#ifdef CONFIG_OF
 static const struct of_device_id altera_freeze_br_of_match[] = {
 	{ .compatible = "altr,freeze-bridge-controller", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, altera_freeze_br_of_match);
+#endif
 
 static int altera_freeze_br_probe(struct platform_device *pdev)
 {
Signature · 1 line
2.32.0
author maintainer
#2 lore raw

PATCH 2/4 fpga: xiilnx-spi: Address warning about unused variable

In reply to Moritz Fischer

warning: ‘xlnx_spi_of_match’ defined but not used
[-Wunused-const-variable]
static const struct of_device_id xlnx_spi_of_match[] = {

Fixes 061c97d13f1a ("fpga manager: Add Xilinx slave serial SPI driver")
Cc Tom Rix <[email protected]>
---
 drivers/fpga/xilinx-spi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/fpga/xilinx-spi.c +2 -0
index fee4d0abf6bf..b6bcf1d9233d 100644
@@ -256,11 +256,13 @@ static int xilinx_spi_probe(struct spi_device *spi)
 	return devm_fpga_mgr_register(&spi->dev, mgr);
 }
 
+#ifdef CONFIG_OF
 static const struct of_device_id xlnx_spi_of_match[] = {
 	{ .compatible = "xlnx,fpga-slave-serial", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, xlnx_spi_of_match);
+#endif
 
 static struct spi_driver xilinx_slave_spi_driver = {
 	.driver = {
Signature · 1 line
2.32.0
author maintainer
#3 lore raw

PATCH 3/4 fpga: xilinx-pr-decoupler: Address warning about unused variable

In reply to Moritz Fischer

warning: ‘xlnx_pr_decoupler_of_match’ defined but not used
[-Wunused-const-variable=]
static const struct of_device_id xlnx_pr_decoupler_of_match[] = {

Fixes 7e961c12be42 ("fpga: Add support for Xilinx LogiCORE PR Decoupler")
Cc Tom Rix <[email protected]>
---
 drivers/fpga/xilinx-pr-decoupler.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/fpga/xilinx-pr-decoupler.c +2 -0
index ea2bde6e5bc4..e986ed47c4ed 100644
@@ -81,6 +81,7 @@ static const struct fpga_bridge_ops xlnx_pr_decoupler_br_ops = {
 	.enable_show = xlnx_pr_decoupler_enable_show,
 };
 
+#ifdef CONFIG_OF
 static const struct xlnx_config_data decoupler_config = {
 	.name = "Xilinx PR Decoupler",
 };
@@ -99,6 +100,7 @@ static const struct of_device_id xlnx_pr_decoupler_of_match[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, xlnx_pr_decoupler_of_match);
+#endif
 
 static int xlnx_pr_decoupler_probe(struct platform_device *pdev)
 {
Signature · 1 line
2.32.0
author maintainer
#4 lore raw

PATCH 4/4 fpga: zynqmp-fpga: Address warning about unused variable

In reply to Moritz Fischer

warning: ‘zynqmp_fpga_of_match’ defined but not used
[-Wunused-const-variable=]
static const struct of_device_id zynqmp_fpga_of_match[] = {

Fixes c09f7471127e ("fpga manager: Adding FPGA Manager support for

Xilinx zynqmp")

---
 drivers/fpga/zynqmp-fpga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/zynqmp-fpga.c +2 -1
index 125743c9797f..b3240f75f0c7 100644
@@ -110,12 +110,13 @@ static int zynqmp_fpga_probe(struct platform_device *pdev)
 	return devm_fpga_mgr_register(dev, mgr);
 }
 
+#ifdef CONFIG_OF
 static const struct of_device_id zynqmp_fpga_of_match[] = {
 	{ .compatible = "xlnx,zynqmp-pcap-fpga", },
 	{},
 };
-
 MODULE_DEVICE_TABLE(of, zynqmp_fpga_of_match);
+#endif
 
 static struct platform_driver zynqmp_fpga_driver = {
 	.probe = zynqmp_fpga_probe,
Signature · 1 line
2.32.0
reviewer
#5 lore raw
In reply to Moritz Fischer
Quoted 9 lines · Moritz Fischer

This patchset addresses a handful of warnings as result of_match_ids being not properly wrapped in #ifdef CONFIG_OF.

Moritz Fischer (4):
fpga: altera-freeze-bridge: Address warning about unused variable
fpga: xiilnx-spi: Address warning about unused variable
fpga: xilinx-pr-decoupler: Address warning about unused variable
fpga: zynqmp-fpga: Address warning about unused variable

Quoted 5 lines
  drivers/fpga/altera-freeze-bridge.c | 2 ++
  drivers/fpga/xilinx-pr-decoupler.c  | 2 ++
  drivers/fpga/xilinx-spi.c           | 2 ++
  drivers/fpga/zynqmp-fpga.c          | 3 ++-
  4 files changed, 8 insertions(+), 1 deletion(-)

I am not seeing these warnings, but it is still worth doing.

I think a few more files need this change.

altera-ps-spi.c, dfl-n3000-nios.c, altera-hps2fpga.c, stratix10-soc.c, socfpga-a10.c, altera-fpga2sdram.c

Not needed for

altera-pr-ip-core-plat.c and ice40-spi.c

These have depends on OF in Kconfig.

Tom

maintainer
#6 lore raw
Quoted 17 lines · Tom Rix
Quoted 9 lines · Moritz Fischer

This patchset addresses a handful of warnings as result of_match_ids being not properly wrapped in #ifdef CONFIG_OF.

Moritz Fischer (4):
fpga: altera-freeze-bridge: Address warning about unused variable
fpga: xiilnx-spi: Address warning about unused variable
fpga: xilinx-pr-decoupler: Address warning about unused variable
fpga: zynqmp-fpga: Address warning about unused variable

Quoted 5 lines
  drivers/fpga/altera-freeze-bridge.c | 2 ++
  drivers/fpga/xilinx-pr-decoupler.c  | 2 ++
  drivers/fpga/xilinx-spi.c           | 2 ++
  drivers/fpga/zynqmp-fpga.c          | 3 ++-
  4 files changed, 8 insertions(+), 1 deletion(-)
Quoted 6 lines

I am not seeing these warnings, but it is still worth doing.

I think a few more files need this change.

altera-ps-spi.c, dfl-n3000-nios.c, altera-hps2fpga.c, stratix10-soc.c, socfpga-a10.c, altera-fpga2sdram.c

dfl-n3000-nios is not using of_device_id, and doesn't need the change.

Thanks,
Yilun

Quoted 8 lines

Not needed for

altera-pr-ip-core-plat.c and ice40-spi.c

These have depends on OF in Kconfig.

Tom

author maintainer Applied
#7 lore raw
Quoted 22 lines · Xu Yilun
Quoted 21 lines · Tom Rix
Quoted 9 lines · Moritz Fischer

This patchset addresses a handful of warnings as result of_match_ids being not properly wrapped in #ifdef CONFIG_OF.

Moritz Fischer (4):
fpga: altera-freeze-bridge: Address warning about unused variable
fpga: xiilnx-spi: Address warning about unused variable
fpga: xilinx-pr-decoupler: Address warning about unused variable
fpga: zynqmp-fpga: Address warning about unused variable

Quoted 5 lines
  drivers/fpga/altera-freeze-bridge.c | 2 ++
  drivers/fpga/xilinx-pr-decoupler.c  | 2 ++
  drivers/fpga/xilinx-spi.c           | 2 ++
  drivers/fpga/zynqmp-fpga.c          | 3 ++-
  4 files changed, 8 insertions(+), 1 deletion(-)

I am not seeing these warnings, but it is still worth doing.

I think a few more files need this change.

Quoted 16 lines
Quoted 2 lines

altera-ps-spi.c, dfl-n3000-nios.c, altera-hps2fpga.c, stratix10-soc.c, socfpga-a10.c, altera-fpga2sdram.c

dfl-n3000-nios is not using of_device_id, and doesn't need the change.

Thanks,
Yilun

Quoted 8 lines

Not needed for

altera-pr-ip-core-plat.c and ice40-spi.c

These have depends on OF in Kconfig.

Tom

Applied to for-next,

Moritz