PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())

This change “PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())” (commit 156acb1) in Linux kernel is authored by Thomas Meyer <thomas [at] m3y3r.de> on Tue Nov 8 22:34:00 2011 +0100.

Description of "PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())"

The change “PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())” introduces changes as follows.

PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())

Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

[The semantic patch that makes this change is available
 in scripts/coccinelle/api/err_cast.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/]

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Linux kernel releases containing commit 156acb1

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "PM / OPP: Use ERR_CAST instead of ERR_PTR(PTR_ERR())"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/base/power/opp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 434a6c011675..95706fa24c73 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -669,7 +669,7 @@ struct srcu_notifier_head *opp_get_notifier(struct device *dev)
 	struct device_opp *dev_opp = find_device_opp(dev);
 
 	if (IS_ERR(dev_opp))
-		return ERR_PTR(PTR_ERR(dev_opp)); /* matching type */
+		return ERR_CAST(dev_opp); /* matching type */
 
 	return &dev_opp->head;
 }

The commit for this change in Linux stable tree is 156acb1 (patch).

Last modified: 2020/02/10