mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev
Subject: Re: [PATCH] iommu: fsl_pamu: Replace NO_IRQ by 0
Date: Thu, 6 Oct 2022 11:34:38 +0100	[thread overview]
Message-ID: <32ecbd1c-0940-85ee-2ca9-687d80317948@arm.com> (raw)
In-Reply-To: <2a2570a8d12c80a7d36837b6c586daa708ca09d7.1665033732.git.christophe.leroy@csgroup.eu>

On 2022-10-06 06:24, Christophe Leroy wrote:
> NO_IRQ is used to check the return of irq_of_parse_and_map().
> 
> On some architecture NO_IRQ is 0, on other architectures it is -1.
> 
> irq_of_parse_and_map() returns 0 on error, independent of NO_IRQ.
> 
> So use 0 instead of using NO_IRQ.

Crucially, NO_IRQ *is* 0 on PowerPC where this driver actually runs, so 
there's no functional issue here. However the justification for cleaning 
it up makes perfect sense overall.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>   drivers/iommu/fsl_pamu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> index 0d03f837a5d4..1b53d2da2c19 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -779,7 +779,7 @@ static int fsl_pamu_probe(struct platform_device *pdev)
>   	of_get_address(dev->of_node, 0, &size, NULL);
>   
>   	irq = irq_of_parse_and_map(dev->of_node, 0);
> -	if (irq == NO_IRQ) {
> +	if (!irq) {
>   		dev_warn(dev, "no interrupts listed in PAMU node\n");
>   		goto error;
>   	}
> @@ -903,7 +903,7 @@ static int fsl_pamu_probe(struct platform_device *pdev)
>   	return 0;
>   
>   error:
> -	if (irq != NO_IRQ)
> +	if (irq)
>   		free_irq(irq, data);
>   
>   	kfree_sensitive(data);

  reply	other threads:[~2022-10-06 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  5:24 Christophe Leroy
2022-10-06 10:34 ` Robin Murphy [this message]
2022-11-03 13:45 ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32ecbd1c-0940-85ee-2ca9-687d80317948@arm.com \
    --to=robin.murphy@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®