diff mbox series

[6/7] of: Constify safe_name() kobject arg

Message ID 20241010-dt-const-v1-6-87a51f558425@kernel.org
State Not Applicable
Headers show
Series of: Constify DT structs | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied fail build log

Commit Message

Rob Herring Oct. 10, 2024, 4:27 p.m. UTC
The kobject is not modified by safe_name() function, so make it const.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 drivers/of/kobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski Oct. 11, 2024, 3:18 p.m. UTC | #1
On Thu, Oct 10, 2024 at 11:27:19AM -0500, Rob Herring (Arm) wrote:
> The kobject is not modified by safe_name() function, so make it const.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>  drivers/of/kobj.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/of/kobj.c b/drivers/of/kobj.c
index aeb1709d4e85..cab9b169dc67 100644
--- a/drivers/of/kobj.c
+++ b/drivers/of/kobj.c
@@ -37,7 +37,7 @@  static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj,
 }
 
 /* always return newly allocated name, caller must free after use */
-static const char *safe_name(struct kobject *kobj, const char *orig_name)
+static const char *safe_name(const struct kobject *kobj, const char *orig_name)
 {
 	const char *name = orig_name;
 	struct kernfs_node *kn;