Skip to content

Commit

Permalink
kconfig: Delete unnecessary checks before the function call "sym_calc…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
Markus Elfring authored and Michal Marek committed Aug 19, 2015
1 parent d770e55 commit 35ffd08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -404,9 +403,7 @@ int conf_read_simple(const char *name, int def)
}
free(line);
fclose(in);

if (modules_sym)
sym_calc_value(modules_sym);
sym_calc_value(modules_sym);
return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions scripts/kconfig/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 35ffd08

Please sign in to comment.