From 3d404803d26dac6f6f72870e57cf25429c9a086d Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Tue, 7 Jul 2015 21:48:23 +0200 Subject: [PATCH] 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 Signed-off-by: Michal Marek Signed-off-by: Christian Lamparter --- config/confdata.c | 7 ++----- config/symbol.c | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/config/confdata.c b/config/confdata.c index 75a6372..d53f345 100644 --- a/config/confdata.c +++ b/config/confdata.c @@ -268,8 +268,7 @@ int conf_read_simple(const char *name, int def) goto load; sym_add_change_count(1); if (!sym_defconfig_list) { - if (modules_sym) - sym_calc_value(modules_sym); + sym_calc_value(modules_sym); return 1; } @@ -404,9 +403,7 @@ setsym: } free(line); fclose(in); - - if (modules_sym) - sym_calc_value(modules_sym); + sym_calc_value(modules_sym); return 0; } diff --git a/config/symbol.c b/config/symbol.c index 70c5ee1..50878dc 100644 --- a/config/symbol.c +++ b/config/symbol.c @@ -467,8 +467,7 @@ void sym_clear_all_valid(void) for_all_symbols(i, sym) sym->flags &= ~SYMBOL_VALID; sym_add_change_count(1); - if (modules_sym) - sym_calc_value(modules_sym); + sym_calc_value(modules_sym); } bool sym_tristate_within_range(struct symbol *sym, tristate val) -- 2.31.1