summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorHerve Codina <herve.codina@bootlin.com>2024-05-27 18:14:40 +0200
committerRob Herring (Arm) <robh@kernel.org>2024-07-09 01:40:30 +0200
commit6badc62f8fa4a1165f3f440943045b73c7a47735 (patch)
tree25dea697e01aec6898c09136213f06fddfebed20 /drivers/of
parentdt-bindings: dma: qcom,gpi: document the SDX75 GPI DMA Engine (diff)
downloadlinux-6badc62f8fa4a1165f3f440943045b73c7a47735.tar.xz
linux-6badc62f8fa4a1165f3f440943045b73c7a47735.zip
of: dynamic: Constify parameter in of_changeset_add_prop_string_array()
The str_array parameter has no reason to be an un-const array. Indeed, elements of the 'str_array' array are not changed by the code. Constify the 'str_array' array parameter. With this const qualifier added, the following construction is allowed: static const char * const tab_str[] = { "string1", "string2" }; of_changeset_add_prop_string_array(..., tab_str, ARRAY_SIZE(tab_str)); Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20240527161450.326615-14-herve.codina@bootlin.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/dynamic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index dda6092e6d3a..70011a98c500 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -984,7 +984,7 @@ EXPORT_SYMBOL_GPL(of_changeset_add_prop_string);
int of_changeset_add_prop_string_array(struct of_changeset *ocs,
struct device_node *np,
const char *prop_name,
- const char **str_array, size_t sz)
+ const char * const *str_array, size_t sz)
{
struct property prop;
int i, ret;