Skip to content

Commit adf7c5b

Browse files
committed
kconfig: squash prop_alloc() into menu_add_prop()
prop_alloc() is only called from menu_add_prop(). Squash it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 6397d96 commit adf7c5b

3 files changed

Lines changed: 17 additions & 23 deletions

File tree

‎scripts/kconfig/lkc.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ struct symbol *sym_choice_default(struct symbol *sym);
112112
struct property *sym_get_range_prop(struct symbol *sym);
113113
const char *sym_get_string_default(struct symbol *sym);
114114
struct symbol *sym_check_deps(struct symbol *sym);
115-
struct property *prop_alloc(enum prop_type type, struct symbol *sym);
116115
struct symbol *prop_get_symbol(struct property *prop);
117116

118117
static inline tristate sym_get_tristate_value(struct symbol *sym)

‎scripts/kconfig/menu.c‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,28 @@ void menu_set_type(int type)
127127
static struct property *menu_add_prop(enum prop_type type, struct expr *expr,
128128
struct expr *dep)
129129
{
130-
struct property *prop = prop_alloc(type, current_entry->sym);
130+
struct property *prop;
131131

132+
prop = xmalloc(sizeof(*prop));
133+
memset(prop, 0, sizeof(*prop));
134+
prop->type = type;
135+
prop->file = current_file;
136+
prop->lineno = zconf_lineno();
132137
prop->menu = current_entry;
133138
prop->expr = expr;
134139
prop->visible.expr = dep;
135140

141+
/* append property to the prop list of symbol */
142+
if (current_entry->sym) {
143+
struct property **propp;
144+
145+
for (propp = &current_entry->sym->prop;
146+
*propp;
147+
propp = &(*propp)->next)
148+
;
149+
*propp = prop;
150+
}
151+
136152
return prop;
137153
}
138154

‎scripts/kconfig/symbol.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,27 +1273,6 @@ struct symbol *sym_check_deps(struct symbol *sym)
12731273
return sym2;
12741274
}
12751275

1276-
struct property *prop_alloc(enum prop_type type, struct symbol *sym)
1277-
{
1278-
struct property *prop;
1279-
struct property **propp;
1280-
1281-
prop = xmalloc(sizeof(*prop));
1282-
memset(prop, 0, sizeof(*prop));
1283-
prop->type = type;
1284-
prop->file = current_file;
1285-
prop->lineno = zconf_lineno();
1286-
1287-
/* append property to the prop list of symbol */
1288-
if (sym) {
1289-
for (propp = &sym->prop; *propp; propp = &(*propp)->next)
1290-
;
1291-
*propp = prop;
1292-
}
1293-
1294-
return prop;
1295-
}
1296-
12971276
struct symbol *prop_get_symbol(struct property *prop)
12981277
{
12991278
if (prop->expr && (prop->expr->type == E_SYMBOL ||

0 commit comments

Comments
 (0)