From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.web.de ([212.227.15.3]:58794 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933461AbbGGTyr (ORCPT ); Tue, 7 Jul 2015 15:54:47 -0400 Subject: [PATCH v3] kconfig: Delete unnecessary checks before the function call "sym_calc_value" References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <54568924.5010008@users.sourceforge.net> <5457CC33.4050906@users.sourceforge.net> From: SF Markus Elfring Message-ID: <559C2E7A.1090408@users.sourceforge.net> Date: Tue, 7 Jul 2015 21:54:34 +0200 MIME-Version: 1.0 In-Reply-To: <5457CC33.4050906@users.sourceforge.net> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: "Yann E. MORIN" , linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall , Paul Bolle From: Markus Elfring Date: Tue, 7 Jul 2015 21:48:23 +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 --- scripts/kconfig/confdata.c | 7 ++----- scripts/kconfig/symbol.c | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c814f57..0b7dc2f 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/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/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 70c5ee1..50878dc 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/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.4.5