aboutsummaryrefslogtreecommitdiff
path: root/scripts/kconfig/symbol.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-07-08 00:38:05 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-07-16 16:07:14 +0900
commit6425e3b247b1eff04c64091b2af8811d05546a86 (patch)
treeaadb6b23bb9ee5ac82ae0f9571aef7dd84df76f2 /scripts/kconfig/symbol.c
parent8bfd6f0923cd7e48aa5d9e5a4e20af818a32c30a (diff)
kconfig: add const qualifiers to several function arguments
Clarify that the given structures are not modified. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/symbol.c')
-rw-r--r--scripts/kconfig/symbol.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index c05d188a1857..3255bf310cb2 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -40,7 +40,7 @@ struct symbol *modules_sym;
static tristate modules_val;
static int sym_warnings;
-enum symbol_type sym_get_type(struct symbol *sym)
+enum symbol_type sym_get_type(const struct symbol *sym)
{
enum symbol_type type = sym->type;
@@ -75,7 +75,7 @@ const char *sym_type_name(enum symbol_type type)
*
* Return: a choice menu if this function is called against a choice member.
*/
-struct menu *sym_get_choice_menu(struct symbol *sym)
+struct menu *sym_get_choice_menu(const struct symbol *sym)
{
struct menu *menu = NULL;
struct menu *m;
@@ -355,7 +355,7 @@ struct symbol *sym_calc_choice(struct menu *choice)
return res;
}
-static void sym_warn_unmet_dep(struct symbol *sym)
+static void sym_warn_unmet_dep(const struct symbol *sym)
{
struct gstr gs = str_new();
@@ -521,7 +521,7 @@ void sym_clear_all_valid(void)
sym_calc_value(modules_sym);
}
-bool sym_tristate_within_range(struct symbol *sym, tristate val)
+bool sym_tristate_within_range(const struct symbol *sym, tristate val)
{
int type = sym_get_type(sym);
@@ -866,7 +866,7 @@ const char *sym_get_string_value(struct symbol *sym)
return (const char *)sym->curr.val;
}
-bool sym_is_changeable(struct symbol *sym)
+bool sym_is_changeable(const struct symbol *sym)
{
return !sym_is_choice(sym) && sym->visible > sym->rev_dep.tri;
}
@@ -1150,7 +1150,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
dep_stack_remove();
}
-static struct symbol *sym_check_expr_deps(struct expr *e)
+static struct symbol *sym_check_expr_deps(const struct expr *e)
{
struct symbol *sym;
@@ -1309,7 +1309,7 @@ struct symbol *sym_check_deps(struct symbol *sym)
return sym2;
}
-struct symbol *prop_get_symbol(struct property *prop)
+struct symbol *prop_get_symbol(const struct property *prop)
{
if (prop->expr && prop->expr->type == E_SYMBOL)
return prop->expr->left.sym;