From patchwork Wed Jan 10 06:56:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10154077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B1EC602D8 for ; Wed, 10 Jan 2018 06:57:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E67127D29 for ; Wed, 10 Jan 2018 06:57:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 132E02818A; Wed, 10 Jan 2018 06:57:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0935827D29 for ; Wed, 10 Jan 2018 06:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbeAJG5b (ORCPT ); Wed, 10 Jan 2018 01:57:31 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:22638 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753547AbeAJG51 (ORCPT ); Wed, 10 Jan 2018 01:57:27 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w0A6uM2k020629; Wed, 10 Jan 2018 15:56:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w0A6uM2k020629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1515567384; bh=sap77Cap95H/8MfygOZ/EKEAvi7suaYTf3LnGeHUnnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StTq+MQerDe/gSD6awZn4kIA1IwsunlcwmOMfmFB6bTowNQh1gxThrlFRJ9AhFJWC ZJYrwfGdNrxQt2Oi40VB/fsiq6mWGfCOSV2V6VsIfFpRg+KsthvUJjP0cRVS4lG+yr Q7BsV9k7hmTPaitNbgxV/riCi65QyiDmNuApVaPHFINc1oB3RlZxs9n1NER/uXyoFN 9mYkvk7e+MZTbWMhuBfo8obDywTaB0GFk5hPSR1pCJXFdbLUIDv5iaiKY4WAUZAuVX XMhTIkMDhkwaPQKK2DBWZbRjxHEgYYN6xCnYxdnW9UfTKyktzz6xml9rzNcyNeBXnA pj8BAXYGKJYiw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , Ulf Magnusson , Marc Herbert , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/6] kconfig: call sym_calc_value() for all symbols before writing to .config Date: Wed, 10 Jan 2018 15:56:10 +0900 Message-Id: <1515567374-12722-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515567374-12722-1-git-send-email-yamada.masahiro@socionext.com> References: <1515567374-12722-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP conf_write() skips sym_calc_value() for "choice", but we do not need to do so. conf_set_all_new_symbols() may have already called sym_calc_value() for "choice", but set_all_choice_value() has cleared SYMBOL_VALID away. So, conf_write() re-calculates "choice" here when calculating the visibility of its children (choice value). We can pass NULL to sym_calc_value() since it is no-op. This should give no impact on behavior, but make the logic more easier to understand. Signed-off-by: Masahiro Yamada Acked-by: Ulf Magnusson --- scripts/kconfig/confdata.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 027f5b4..bc83965 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -790,6 +790,8 @@ int conf_write(const char *name) menu = rootmenu.list; while (menu) { sym = menu->sym; + sym_calc_value(sym); + if (!sym) { if (!menu_is_visible(menu)) goto next; @@ -799,7 +801,6 @@ int conf_write(const char *name) "# %s\n" "#\n", str); } else if (!(sym->flags & SYMBOL_CHOICE)) { - sym_calc_value(sym); if (!(sym->flags & SYMBOL_WRITE)) goto next; sym->flags &= ~SYMBOL_WRITE;