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: 124025 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4924895qgn; Tue, 9 Jan 2018 22:58:37 -0800 (PST) X-Google-Smtp-Source: ACJfBotn+dSt3nz0pvwvWpAJg6/0N/3t+IiJWB04cecTqt/vfq9NOcif688nMlaCPZSUEgAOKeHk X-Received: by 10.84.237.9 with SMTP id s9mr1394619plk.176.1515567517166; Tue, 09 Jan 2018 22:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515567517; cv=none; d=google.com; s=arc-20160816; b=kxEDeDYTg7qy63Rpk0w5KCMRxsqJ0phtK1gjy8M6BBezXuiGMTU2DVr3t4jmVm2RVg f8NrA3pi8Dty1h0pGbKtkLirKoLHORcBjCz4jbHUo5WK32licB5vsZg6FKC3Jk+BSmia J7iXUyH42YpYMQLcPOcUStLe/pcfOdjDOdVsiovbG9SBoRVId4HmqSzh3aJWcmMp9AQ9 hQh77i3cIYbATEmGEnz9N4M/hvjXzaE76hx4boXE3G6ht1uq2LMeyQ5CInea9ETZyS21 mKCJk+6c7MCYLSwyviOsGrW1777FBMC0ygSzNL+FYO/C1s1xQJK5/0uFtgWgcTdN2hcj KXUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=sap77Cap95H/8MfygOZ/EKEAvi7suaYTf3LnGeHUnnM=; b=q2XgwkRFfXbrcJBYKQ5F560Qbj79X8fM/WIdqXTdmrFZrK+O4zni8kz2DNJVTvk5mb CuJ7GEZHwvCJ3pZxaIhtqHcxigMEXj9BFoM/SQqbQNx9aOD3VZFNkPb8YdJFrrK5TPoV 3gJlyafnPAECNJlG5v3w1VNFETOV2SR3G4yGix+iT/Zx5opnr1imL1qmefqhsBfcusYA BJtPykXIz6caBTNTTIg7betmrQSVPNG+fSsv5rJ8d1lznSLQANAPdQgRQ3VrPAIex8Tz +C0NvPnhGtt/0a1Fdnq5KDEBoUdpvjykNERu5mjiuROsXOCg5VnJIejUZNBmZTCWOyy5 17yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=StTq+MQe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si6279203pfi.402.2018.01.09.22.58.36; Tue, 09 Jan 2018 22:58:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=StTq+MQe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753882AbeAJG5g (ORCPT + 28 others); Wed, 10 Jan 2018 01:57:36 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- scripts/kconfig/confdata.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 Acked-by: Ulf Magnusson 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;