linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe
@ 2020-09-22 19:49 Krzysztof Wilczyński
  2020-10-01 17:07 ` Rob Herring
  2020-10-09 12:43 ` Lorenzo Pieralisi
  0 siblings, 2 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-22 19:49 UTC (permalink / raw)
  To: Ray Jui
  Cc: Bjorn Helgaas, Lorenzo Pieralisi, Rob Herring, Scott Branden,
	linux-pci, linux-arm-kernel, bcm-kernel-feedback-list

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

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


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

* Re: [PATCH] PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe
  2020-09-22 19:49 [PATCH] PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe Krzysztof Wilczyński
@ 2020-10-01 17:07 ` Rob Herring
  2020-10-09 12:43 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2020-10-01 17:07 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Ray Jui, Bjorn Helgaas, Lorenzo Pieralisi, Scott Branden,
	linux-pci, linux-arm-kernel, bcm-kernel-feedback-list

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>

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

* Re: [PATCH] PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe
  2020-09-22 19:49 [PATCH] PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe Krzysztof Wilczyński
  2020-10-01 17:07 ` Rob Herring
@ 2020-10-09 12:43 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 3+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-09 12:43 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Ray Jui, Bjorn Helgaas, Rob Herring, Scott Branden, linux-pci,
	linux-arm-kernel, bcm-kernel-feedback-list

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
> 

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

end of thread, other threads:[~2020-10-09 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 19:49 [PATCH] PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe Krzysztof Wilczyński
2020-10-01 17:07 ` Rob Herring
2020-10-09 12:43 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).