Skip to contentSkip to conversation

PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe

PATCH Applied Krzysztof Wilczyński 3 participants 3 messages Sep 22, 2020 – Oct 9, 2020

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

PATCH 1/1 PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe

Fix sparse build warning:

drivers/pci/controller/pcie-iproc-platform.c:102:33: warning: Using plain integer as NULL pointer

The map_irq member of the struct iproc_pcie takes a function pointer serving as a callback to map interrupts, therefore we should pass a NULL pointer to it rather than a integer in the iproc_pcie_pltfm_probe() function.

Related:
commit b64aa11eb2dd ("PCI: Set bridge map_irq and swizzle_irq to default functions")

---
 drivers/pci/controller/pcie-iproc-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pcie-iproc-platform.c +1 -1
index a956b0c18bd1..b93e7bda101b 100644
@@ -99,7 +99,7 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 	switch (pcie->type) {
 	case IPROC_PCIE_PAXC:
 	case IPROC_PCIE_PAXC_V2:
-		pcie->map_irq = 0;
+		pcie->map_irq = NULL;
 		break;
 	default:
 		break;
Signature · 1 line
2.28.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Krzysztof Wilczyński

Fix sparse build warning:

drivers/pci/controller/pcie-iproc-platform.c:102:33: warning: Using plain integer as NULL pointer

The map_irq member of the struct iproc_pcie takes a function pointer serving as a callback to map interrupts, therefore we should pass a NULL pointer to it rather than a integer in the iproc_pcie_pltfm_probe() function.

Quoted 8 lines

Related:
commit b64aa11eb2dd ("PCI: Set bridge map_irq and swizzle_irq to default functions")

---
 drivers/pci/controller/pcie-iproc-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Not sure what I was smoking that day...

#2 lore raw
In reply to Krzysztof Wilczyński
Quoted 9 lines · Krzysztof Wilczyński

Fix sparse build warning:

drivers/pci/controller/pcie-iproc-platform.c:102:33: warning: Using plain integer as NULL pointer

The map_irq member of the struct iproc_pcie takes a function pointer serving as a callback to map interrupts, therefore we should pass a NULL pointer to it rather than a integer in the iproc_pcie_pltfm_probe() function.

Quoted 8 lines

Related:
commit b64aa11eb2dd ("PCI: Set bridge map_irq and swizzle_irq to default functions")

---
 drivers/pci/controller/pcie-iproc-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to pci/iproc, thanks.

Lorenzo

Quoted 16 lines
drivers/pci/controller/pcie-iproc-platform.c +1 -1
index a956b0c18bd1..b93e7bda101b 100644
@@ -99,7 +99,7 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 	switch (pcie->type) {
 	case IPROC_PCIE_PAXC:
 	case IPROC_PCIE_PAXC_V2:
-		pcie->map_irq = 0;
+		pcie->map_irq = NULL;
 		break;
 	default:
 		break;
Signature · 1 line
2.28.0