Skip to content

Commit

Permalink
of: Constify safe_name() kobject arg
Browse files Browse the repository at this point in the history
The kobject is not modified by safe_name() function, so make it const.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241010-dt-const-v1-6-87a51f558425@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
  • Loading branch information
robherring committed Oct 15, 2024
1 parent 7118782 commit 3539089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/kobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3539089

Please sign in to comment.