Skip to content

Commit 0dce631

Browse files
lacombarmichal42
authored andcommitted
kconfig: nuke second argument of conf_write_symbol()
Replacing S_TRISTATE by S_BOOLEAN is a no-op for conf_write_symbol(). Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> [mmarek: Fix unused variable warning in conf_write()] Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 6e71fab commit 0dce631

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

‎scripts/kconfig/confdata.c‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,11 @@ static void conf_write_string(bool headerfile, const char *name,
440440
fputs("\"\n", out);
441441
}
442442

443-
static void conf_write_symbol(struct symbol *sym, enum symbol_type type,
444-
FILE *out, bool write_no)
443+
static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no)
445444
{
446445
const char *str;
447446

448-
switch (type) {
447+
switch (sym->type) {
449448
case S_BOOLEAN:
450449
case S_TRISTATE:
451450
switch (sym_get_tristate_value(sym)) {
@@ -532,7 +531,7 @@ int conf_write_defconfig(const char *filename)
532531
goto next_menu;
533532
}
534533
}
535-
conf_write_symbol(sym, sym->type, out, true);
534+
conf_write_symbol(sym, out, true);
536535
}
537536
next_menu:
538537
if (menu->list != NULL) {
@@ -561,7 +560,6 @@ int conf_write(const char *name)
561560
const char *basename;
562561
const char *str;
563562
char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
564-
enum symbol_type type;
565563
time_t now;
566564
int use_timestamp = 1;
567565
char *env;
@@ -633,14 +631,8 @@ int conf_write(const char *name)
633631
if (!(sym->flags & SYMBOL_WRITE))
634632
goto next;
635633
sym->flags &= ~SYMBOL_WRITE;
636-
type = sym->type;
637-
if (type == S_TRISTATE) {
638-
sym_calc_value(modules_sym);
639-
if (modules_sym->curr.tri == no)
640-
type = S_BOOLEAN;
641-
}
642634
/* Write config symbol to file */
643-
conf_write_symbol(sym, type, out, true);
635+
conf_write_symbol(sym, out, true);
644636
}
645637

646638
next:
@@ -842,7 +834,7 @@ int conf_write_autoconf(void)
842834
continue;
843835

844836
/* write symbol to config file */
845-
conf_write_symbol(sym, sym->type, out, false);
837+
conf_write_symbol(sym, out, false);
846838

847839
/* update autoconf and tristate files */
848840
switch (sym->type) {

0 commit comments

Comments
 (0)