Skip to contentSkip to conversation

irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init()

PATCH Applied Yang Yingliang 3 participants 4 messages Mar 16, 2022 – Apr 5, 2022 irqchip drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init()

If devm_platform_ioremap_resource() fails, it never returns NULL, replace NULL check with IS_ERR().

Fixes a6199bb514d8 ("irqchip: Add Qualcomm MPM controller driver")
---
 drivers/irqchip/irq-qcom-mpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-qcom-mpm.c +1 -1
index eea5a753618c..d30614661eea 100644
@@ -375,7 +375,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 	raw_spin_lock_init(&priv->lock);
 
 	priv->base = devm_platform_ioremap_resource(pdev, 0);
-	if (!priv->base)
+	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
 	for (i = 0; i < priv->reg_stride; i++) {
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Yang Yingliang

If devm_platform_ioremap_resource() fails, it never returns NULL, replace NULL check with IS_ERR().

Fixes a6199bb514d8 ("irqchip: Add Qualcomm MPM controller driver")
---
 drivers/irqchip/irq-qcom-mpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-qcom-mpm.c +0 -0
index eea5a753618c..d30614661eea 100644

drivers/irqchip/irq-qcom-mpm.c static int qcom_mpm_init(struct device_node *np, struct device_node *parent) · line 378

Quoted 5 lines
drivers/irqchip/irq-qcom-mpm.c +1 -1
@@ -375,7 +375,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 	raw_spin_lock_init(&priv->lock);
 
 	priv->base = devm_platform_ioremap_resource(pdev, 0);
-	if (!priv->base)
+	if (IS_ERR(priv->base))

Oops! Thanks for the fixing!

Quoted 6 lines
drivers/irqchip/irq-qcom-mpm.c +0 -0
 		return PTR_ERR(priv->base);
 
 	for (i = 0; i < priv->reg_stride; i++) {
Signature · 1 line
2.25.1
#2 lore raw
In reply to Yang Yingliang
The following commit has been merged into the irq/irqchip-next branch of irqchip:

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     294aee8ab6cb5d44cde4defcda43324a25c64118
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/294aee8ab6cb5d44cde4defcda43324a25c64118
Author:        Yang Yingliang <[email protected]>
AuthorDate:    Wed, 16 Mar 2022 10:51:00 +08:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Thu, 17 Mar 2022 15:30:35 

irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init()

If devm_platform_ioremap_resource() fails, it never returns NULL, replace NULL check with IS_ERR().

---
 drivers/irqchip/irq-qcom-mpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-qcom-mpm.c +1 -1
index eea5a75..d306146 100644
@@ -375,7 +375,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 	raw_spin_lock_init(&priv->lock);
 
 	priv->base = devm_platform_ioremap_resource(pdev, 0);
-	if (!priv->base)
+	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
 	for (i = 0; i < priv->reg_stride; i++) {
#3 lore raw
In reply to Yang Yingliang
The following commit has been merged into the irq/irqchip-fixes branch of irqchip:

The following commit has been merged into the irq/irqchip-fixes branch of irqchip:

Commit-ID:     76ff614a79152cee07a2c48080c3dc91c56f0f1d
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/76ff614a79152cee07a2c48080c3dc91c56f0f1d
Author:        Yang Yingliang <[email protected]>
AuthorDate:    Wed, 16 Mar 2022 10:51:00 +08:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Tue, 05 Apr 2022 16:33:13 +01:00

irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init()

If devm_platform_ioremap_resource() fails, it never returns NULL, replace NULL check with IS_ERR().

---
 drivers/irqchip/irq-qcom-mpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-qcom-mpm.c +1 -1
index eea5a75..d306146 100644
@@ -375,7 +375,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
 	raw_spin_lock_init(&priv->lock);
 
 	priv->base = devm_platform_ioremap_resource(pdev, 0);
-	if (!priv->base)
+	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
 	for (i = 0; i < priv->reg_stride; i++) {