[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250410-fix_swnode-v1-1-081c95cf7cf9@quicinc.com>
Date: Thu, 10 Apr 2025 21:12:11 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>
Cc: Zijun Hu <zijun_hu@...oud.com>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: [PATCH 1/2] software node: Add comment for the first ERR_CAST() in
fwnode_create_software_node()
From: Zijun Hu <quic_zijuhu@...cinc.com>
ERR_CAST() is normally used to cast an error-valued pointer type to
another different type, But the first ERR_CAST() is to cast away the
const in fwnode_create_software_node().
Add comment for this unusual ERR_CAST() usage.
Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
drivers/base/swnode.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index b1726a3515f6fbe13c2186af1f74479263798e42..67040fff99b02c43999b175c2ba7e6d04322a446 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -933,6 +933,7 @@ fwnode_create_software_node(const struct property_entry *properties,
struct software_node *node;
struct swnode *p;
+ /* Only cast away the const by ERR_CAST() */
if (IS_ERR(parent))
return ERR_CAST(parent);
--
2.34.1
Powered by blists - more mailing lists