kconfig: Delete unnecessary checks before the function call "sym_calc_value"
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 7 Jul 2015 19:48:23 +0000 (21:48 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Wed, 27 Apr 2016 14:17:14 +0000 (16:17 +0200)
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/confdata.c
config/symbol.c

index 75a63725bad4e77b229ada800414f746d5dd2408..d53f34564141e6315b7627a48623229e41ed5e8d 100644 (file)
@@ -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;
 }
 
index 70c5ee189dce7c7d573c044117d3f63e4450cbcb..50878dc025a5746d51316c6f1bd4c1e1b8a41707 100644 (file)
@@ -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)