Skip to contentSkip to conversation

PM / devfreq: imx: Fix inconsistent IS_ERR and PTR_ERR

PATCH Applied Gustavo A. R. Silva 3 participants 4 messages May 7, 2020 – May 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM / devfreq: imx: Fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc().

The proper pointer to be passed as argument to PTR_ERR() is priv->icc_pdev.

This bug was detected with the help of Coccinelle.

Fixes 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device")
---
 drivers/devfreq/imx-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/devfreq/imx-bus.c +2 -2
index 532e7954032f..4f38455ad742 100644
@@ -88,8 +88,8 @@ static int imx_bus_init_icc(struct device *dev)
 			dev, icc_driver_name, -1, NULL, 0);
 	if (IS_ERR(priv->icc_pdev)) {
 		dev_err(dev, "failed to register icc provider %s: %ld\n",
-				icc_driver_name, PTR_ERR(priv->devfreq));
-		return PTR_ERR(priv->devfreq);
+				icc_driver_name, PTR_ERR(priv->icc_pdev));
+		return PTR_ERR(priv->icc_pdev);
 	}
 
 	return 0;
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines

From: Gustavo A. R. Silva <[email protected]>
Sent: Thursday, May 7, 2020 9:13 PM

Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc().

Quoted 7 lines

The proper pointer to be passed as argument to PTR_ERR() is priv->icc_pdev.

This bug was detected with the help of Coccinelle.

Fixes 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device")

Thanks for the fix.

Regards
Aisheng

Quoted 21 lines
---
 drivers/devfreq/imx-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/devfreq/imx-bus.c index renamed from drivers/devfreq/imx-bus.c +0 -0

532e7954032f..4f38455ad742 100644

drivers/devfreq/imx-bus.c +2 -3
@@ -88,8 +88,8 @@ static int imx_bus_init_icc(struct device *dev)
 			dev, icc_driver_name, -1, NULL, 0);
 	if (IS_ERR(priv->icc_pdev)) {
 		dev_err(dev, "failed to register icc provider %s: %ld\n",
-				icc_driver_name, PTR_ERR(priv->devfreq));
-		return PTR_ERR(priv->devfreq);
+				icc_driver_name, PTR_ERR(priv->icc_pdev));
+		return PTR_ERR(priv->icc_pdev);
 	}
 
 	return 0;
--

2.26.2

maintainer Applied
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 19 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc().

The proper pointer to be passed as argument to PTR_ERR() is priv->icc_pdev.

This bug was detected with the help of Coccinelle.

Fixes 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device")
---
 drivers/devfreq/imx-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/devfreq/imx-bus.c +0 -0
index 532e7954032f..4f38455ad742 100644

drivers/devfreq/imx-bus.c static int imx_bus_init_icc(struct device *dev) · line 95

Quoted 10 lines
drivers/devfreq/imx-bus.c +2 -2
@@ -88,8 +88,8 @@ static int imx_bus_init_icc(struct device *dev)
 			dev, icc_driver_name, -1, NULL, 0);
 	if (IS_ERR(priv->icc_pdev)) {
 		dev_err(dev, "failed to register icc provider %s: %ld\n",
-				icc_driver_name, PTR_ERR(priv->devfreq));
-		return PTR_ERR(priv->devfreq);
+				icc_driver_name, PTR_ERR(priv->icc_pdev));
+		return PTR_ERR(priv->icc_pdev);
 	}
 
 	return 0;

Applied it. Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics
maintainer
#3 lore raw
Quoted 28 lines · Chanwoo Choi
Quoted 27 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc().

The proper pointer to be passed as argument to PTR_ERR() is priv->icc_pdev.

This bug was detected with the help of Coccinelle.

Fixes 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device")
---
 drivers/devfreq/imx-bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/devfreq/imx-bus.c +2 -2
index 532e7954032f..4f38455ad742 100644
@@ -88,8 +88,8 @@ static int imx_bus_init_icc(struct device *dev)
 			dev, icc_driver_name, -1, NULL, 0);
 	if (IS_ERR(priv->icc_pdev)) {
 		dev_err(dev, "failed to register icc provider %s: %ld\n",
-				icc_driver_name, PTR_ERR(priv->devfreq));
-		return PTR_ERR(priv->devfreq);
+				icc_driver_name, PTR_ERR(priv->icc_pdev));
+		return PTR_ERR(priv->icc_pdev);
 	}
 
Quoted 5 lines

drivers/devfreq/imx-bus.c static int imx_bus_init_icc(struct device *dev) · line 95

Quoted 2 lines
drivers/devfreq/imx-bus.c +0 -0
 	return 0;

Applied it. Thanks.

I edit the patch title as following:
- before : PM / devfreq: imx: Fix inconsistent IS_ERR and PTR_ERR
- after : PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR

Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics