mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
@ 2024-02-01 12:17 Dan Carpenter
  2024-02-01 16:25 ` Konrad Dybcio
  2024-02-13  9:31 ` [tip: irq/urgent] " tip-bot2 for Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-02-01 12:17 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Thomas Gleixner, Bryan O'Donoghue, Shawn Guo, linux-kernel,
	kernel-janitors

The devm_ioremap() function doesn't return error pointers, it returns
NULL on error.  Update the check accordingly.

Fixes: 221b110d87c2 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/irqchip/irq-qcom-mpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-qcom-mpm.c b/drivers/irqchip/irq-qcom-mpm.c
index cda5838d2232..7942d8eb3d00 100644
--- a/drivers/irqchip/irq-qcom-mpm.c
+++ b/drivers/irqchip/irq-qcom-mpm.c
@@ -389,8 +389,8 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 		/* Don't use devm_ioremap_resource, as we're accessing a shared region. */
 		priv->base = devm_ioremap(dev, res.start, resource_size(&res));
 		of_node_put(msgram_np);
-		if (IS_ERR(priv->base))
-			return PTR_ERR(priv->base);
+		if (!priv->base)
+			return -ENOMEM;
 	} else {
 		/* Otherwise, fall back to simple MMIO. */
 		priv->base = devm_platform_ioremap_resource(pdev, 0);
-- 
2.43.0


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

* Re: [PATCH] irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
  2024-02-01 12:17 [PATCH] irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init() Dan Carpenter
@ 2024-02-01 16:25 ` Konrad Dybcio
  2024-02-13  9:31 ` [tip: irq/urgent] " tip-bot2 for Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2024-02-01 16:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Thomas Gleixner, Bryan O'Donoghue, Shawn Guo, linux-kernel,
	kernel-janitors

On 1.02.2024 13:17, Dan Carpenter wrote:
> The devm_ioremap() function doesn't return error pointers, it returns
> NULL on error.  Update the check accordingly.
> 
> Fixes: 221b110d87c2 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---

Thanks!

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* [tip: irq/urgent] irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
  2024-02-01 12:17 [PATCH] irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init() Dan Carpenter
  2024-02-01 16:25 ` Konrad Dybcio
@ 2024-02-13  9:31 ` tip-bot2 for Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Dan Carpenter @ 2024-02-13  9:31 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Dan Carpenter, Thomas Gleixner, Konrad Dybcio, x86, linux-kernel, maz

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     8ad032cc8c499af6f3289c796f411e8874b50fdb
Gitweb:        https://git.kernel.org/tip/8ad032cc8c499af6f3289c796f411e8874b50fdb
Author:        Dan Carpenter <dan.carpenter@linaro.org>
AuthorDate:    Thu, 01 Feb 2024 15:17:50 +03:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 13 Feb 2024 10:26:15 +01:00

irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()

devm_ioremap() doesn't return error pointers, it returns NULL on error.
Update the check accordingly.

Fixes: 221b110d87c2 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/22e1f4de-edce-4791-bd2d-2b2e98529492@moroto.mountain

---
 drivers/irqchip/irq-qcom-mpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-qcom-mpm.c b/drivers/irqchip/irq-qcom-mpm.c
index cda5838..7942d8e 100644
--- a/drivers/irqchip/irq-qcom-mpm.c
+++ b/drivers/irqchip/irq-qcom-mpm.c
@@ -389,8 +389,8 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 		/* Don't use devm_ioremap_resource, as we're accessing a shared region. */
 		priv->base = devm_ioremap(dev, res.start, resource_size(&res));
 		of_node_put(msgram_np);
-		if (IS_ERR(priv->base))
-			return PTR_ERR(priv->base);
+		if (!priv->base)
+			return -ENOMEM;
 	} else {
 		/* Otherwise, fall back to simple MMIO. */
 		priv->base = devm_platform_ioremap_resource(pdev, 0);

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

end of thread, other threads:[~2024-02-13  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 12:17 [PATCH] irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init() Dan Carpenter
2024-02-01 16:25 ` Konrad Dybcio
2024-02-13  9:31 ` [tip: irq/urgent] " tip-bot2 for Dan Carpenter

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®