Commit 17742dc743716eebbf5892add0e0bf91f541fc39

Authored by Michal Marek
1 parent 1137c56b74

kconfig: Make expr_copy() take a const argument

Fixes
scripts/kconfig/expr.c: In function ‘expr_get_leftmost_symbol’:
scripts/kconfig/expr.c:1026:2: warning: passing argument 1 of ‘expr_copy’ discards qualifiers from pointer target type
scripts/kconfig/expr.c:67:14: note: expected ‘struct expr *’ but argument is of type ‘const struct expr *’

Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

scripts/kconfig/expr.c
... ... @@ -64,7 +64,7 @@
64 64 return e2 ? expr_alloc_two(E_OR, e1, e2) : e1;
65 65 }
66 66  
67   -struct expr *expr_copy(struct expr *org)
  67 +struct expr *expr_copy(const struct expr *org)
68 68 {
69 69 struct expr *e;
70 70  
scripts/kconfig/expr.h
... ... @@ -191,7 +191,7 @@
191 191 struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2);
192 192 struct expr *expr_alloc_and(struct expr *e1, struct expr *e2);
193 193 struct expr *expr_alloc_or(struct expr *e1, struct expr *e2);
194   -struct expr *expr_copy(struct expr *org);
  194 +struct expr *expr_copy(const struct expr *org);
195 195 void expr_free(struct expr *e);
196 196 int expr_eq(struct expr *e1, struct expr *e2);
197 197 void expr_eliminate_eq(struct expr **ep1, struct expr **ep2);