Skip to contentSkip to conversation

PCI: mt7621: address some kernel test robot reported warnings

PATCH In review Sergio Paracuellos 2 participants 5 messages Jan 24, 2022 – Jan 26, 2022

Subsystems (4)
lore
Share & tools
lore

Sergio Paracuellos

author maintainer
#0 lore raw

cover PCI: mt7621: address some kernel test robot reported warnings

Kernel test robot complains about two things here[0]:
- pcie_rmw() [-Wunused-function]
- 'mt7621_pcie_ids' [-Wunused-const-variable]

Address this two warnings in this small two patches.

Best regards,
Sergio Paracuellos

[0]: https://lkml.org/lkml/2022/1/24/264

Sergio Paracuellos (2):
PCI: mt7621: drop 'of_match_ptr' to fix -Wunused-const-variable
PCI: mt7621: remove unused function pcie_rmw()

 drivers/pci/controller/pcie-mt7621.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/2 PCI: mt7621: drop 'of_match_ptr' to fix -Wunused-const-variable

The of_device_id is included unconditionally by of.h header and used in the driver as well. Remove of_match_ptr to fix W=1 compile test warning with !CONFIG_OF:

drivers/pci/controller/pcie-mt7621.c:549:34: warning: unused variable 'mt7621_pcie_ids' [-Wunused-const-variable]

Fixes 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver")
---
 drivers/pci/controller/pcie-mt7621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pcie-mt7621.c +1 -1
index 3824862ea144..f2e567282d3e 100644
@@ -557,7 +557,7 @@ static struct platform_driver mt7621_pcie_driver = {
 	.remove = mt7621_pcie_remove,
 	.driver = {
 		.name = "mt7621-pci",
-		.of_match_table = of_match_ptr(mt7621_pcie_ids),
+		.of_match_table = mt7621_pcie_ids,
 	},
 };
 builtin_platform_driver(mt7621_pcie_driver);
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 2/2 PCI: mt7621: remove unused function pcie_rmw()

In reply to Sergio Paracuellos

Function pcie_rmw() is not being used at all and be deleted. Hence get rid of it. This fix the following complain warning:

drivers/pci/controller/pcie-mt7621.c:112:20: warning: unused function 'pcie_rmw' [-Wunused-function]

Fixes 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver")
---
 drivers/pci/controller/pcie-mt7621.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/pci/controller/pcie-mt7621.c +0 -9
index f2e567282d3e..33eb37a2225c 100644
@@ -109,15 +109,6 @@ static inline void pcie_write(struct mt7621_pcie *pcie, u32 val, u32 reg)
 	writel_relaxed(val, pcie->base + reg);
 }
 
-static inline void pcie_rmw(struct mt7621_pcie *pcie, u32 reg, u32 clr, u32 set)
-{
-	u32 val = readl_relaxed(pcie->base + reg);
-
-	val &= ~clr;
-	val |= set;
-	writel_relaxed(val, pcie->base + reg);
-}
-
 static inline u32 pcie_port_read(struct mt7621_pcie_port *port, u32 reg)
 {
 	return readl_relaxed(port->base + reg);
Signature · 1 line
2.25.1
#3 lore raw
In reply to Sergio Paracuellos
Quoted 9 lines · Sergio Paracuellos

Kernel test robot complains about two things here[0]:
- pcie_rmw() [-Wunused-function]
- 'mt7621_pcie_ids' [-Wunused-const-variable]

Address this two warnings in this small two patches.

Best regards,
Sergio Paracuellos

Quoted 8 lines

[0]: https://lkml.org/lkml/2022/1/24/264

Sergio Paracuellos (2):
PCI: mt7621: drop 'of_match_ptr' to fix -Wunused-const-variable
PCI: mt7621: remove unused function pcie_rmw()

 drivers/pci/controller/pcie-mt7621.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Both applied to for-linus for v5.17, thank you!

author maintainer
#4 lore raw
Quoted 13 lines · Bjorn Helgaas
Quoted 11 lines · Sergio Paracuellos

Kernel test robot complains about two things here[0]:
- pcie_rmw() [-Wunused-function]
- 'mt7621_pcie_ids' [-Wunused-const-variable]

Address this two warnings in this small two patches.

Best regards,
Sergio Paracuellos

[0]: https://lkml.org/lkml/2022/1/24/264

Quoted 8 lines
Quoted 6 lines

Sergio Paracuellos (2):
PCI: mt7621: drop 'of_match_ptr' to fix -Wunused-const-variable
PCI: mt7621: remove unused function pcie_rmw()

 drivers/pci/controller/pcie-mt7621.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Both applied to for-linus for v5.17, thank you!

Thanks for letting me know, Bjorn.

Best regards,
Sergio Paracuellos