Skip to content

Commit 35ffd08

Browse files
elfringMichal Marek
authored andcommitted
kconfig: Delete unnecessary checks before the function call "sym_calc_value"
The sym_calc_value() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent d770e55 commit 35ffd08

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

scripts/kconfig/confdata.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ int conf_read_simple(const char *name, int def)
268268
goto load;
269269
sym_add_change_count(1);
270270
if (!sym_defconfig_list) {
271-
if (modules_sym)
272-
sym_calc_value(modules_sym);
271+
sym_calc_value(modules_sym);
273272
return 1;
274273
}
275274

@@ -404,9 +403,7 @@ int conf_read_simple(const char *name, int def)
404403
}
405404
free(line);
406405
fclose(in);
407-
408-
if (modules_sym)
409-
sym_calc_value(modules_sym);
406+
sym_calc_value(modules_sym);
410407
return 0;
411408
}
412409

scripts/kconfig/symbol.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ void sym_clear_all_valid(void)
467467
for_all_symbols(i, sym)
468468
sym->flags &= ~SYMBOL_VALID;
469469
sym_add_change_count(1);
470-
if (modules_sym)
471-
sym_calc_value(modules_sym);
470+
sym_calc_value(modules_sym);
472471
}
473472

474473
bool sym_tristate_within_range(struct symbol *sym, tristate val)

0 commit comments

Comments
 (0)