diff mbox series

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

Message ID 20200922194932.465925-1-kw@linux.com
State New, archived
Headers show
Series PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe | expand

Commit Message

Krzysztof Wilczyński Sept. 22, 2020, 7:49 p.m. UTC
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")

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/controller/pcie-iproc-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring Oct. 1, 2020, 5:07 p.m. UTC | #1
On Tue, Sep 22, 2020 at 07:49:32PM +0000, Krzysztof Wilczyński wrote:
> 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")
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
> ---
>  drivers/pci/controller/pcie-iproc-platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Not sure what I was smoking that day...

Reviewed-by: Rob Herring <robh@kernel.org>
Lorenzo Pieralisi Oct. 9, 2020, 12:43 p.m. UTC | #2
On Tue, Sep 22, 2020 at 07:49:32PM +0000, Krzysztof Wilczyński wrote:
> 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")
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
> ---
>  drivers/pci/controller/pcie-iproc-platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to pci/iproc, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pcie-iproc-platform.c b/drivers/pci/controller/pcie-iproc-platform.c
> index a956b0c18bd1..b93e7bda101b 100644
> --- a/drivers/pci/controller/pcie-iproc-platform.c
> +++ b/drivers/pci/controller/pcie-iproc-platform.c
> @@ -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;
> -- 
> 2.28.0
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/pcie-iproc-platform.c b/drivers/pci/controller/pcie-iproc-platform.c
index a956b0c18bd1..b93e7bda101b 100644
--- a/drivers/pci/controller/pcie-iproc-platform.c
+++ b/drivers/pci/controller/pcie-iproc-platform.c
@@ -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;