From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Anup Patel <apatel@ventanamicro.com>
Cc: "Anup Patel" <anup@brainfault.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Björn Töpel" <bjorn@rivosinc.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] irqchip/riscv-aplic: Fix an IS_ERR() vs NULL bug in probe()
Date: Tue, 20 Aug 2024 16:54:32 +0800 [thread overview]
Message-ID: <ae6a4702-3225-620c-e83b-b8736ac486a8@huawei.com> (raw)
In-Reply-To: <a5a628d6-81d8-4933-81a8-64aad4743ec4@stanley.mountain>
On 2024/8/20 16:42, Dan Carpenter wrote:
> The devm_platform_ioremap_resource() function doesn't return NULL, it
> returns error pointers. Fix the error handling to match.
>
> Fixes: 2333df5ae51e ("irqchip: Add RISC-V advanced PLIC driver for direct-mode")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/irqchip/irq-riscv-aplic-main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-riscv-aplic-main.c
> index 28dd175b5764..981fad6fb8f7 100644
> --- a/drivers/irqchip/irq-riscv-aplic-main.c
> +++ b/drivers/irqchip/irq-riscv-aplic-main.c
> @@ -175,9 +175,9 @@ static int aplic_probe(struct platform_device *pdev)
>
> /* Map the MMIO registers */
> regs = devm_platform_ioremap_resource(pdev, 0);
> - if (!regs) {
> + if (IS_ERR(regs)) {
> dev_err(dev, "failed map MMIO registers\n");
> - return -ENOMEM;
> + return PTR_ERR(regs);
LGTM
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
> }
>
> /*
next prev parent reply other threads:[~2024-08-20 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 8:42 Dan Carpenter
2024-08-20 8:54 ` Jinjie Ruan [this message]
2024-08-20 9:19 ` Anup Patel
2024-08-20 15:12 ` [tip: irq/urgent] " tip-bot2 for Dan Carpenter
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=ae6a4702-3225-620c-e83b-b8736ac486a8@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=bjorn@rivosinc.com \
--cc=dan.carpenter@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=tglx@linutronix.de \
/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®