From patchwork Wed Jan 10 06:56:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10154093 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 18311602D8 for ; Wed, 10 Jan 2018 06:59:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AE9B2818A for ; Wed, 10 Jan 2018 06:59:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1A81281C3; Wed, 10 Jan 2018 06:59:57 +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 A30E12818A for ; Wed, 10 Jan 2018 06:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753545AbeAJG5b (ORCPT ); Wed, 10 Jan 2018 01:57:31 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:22640 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280AbeAJG51 (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 w0A6uM2l020629; Wed, 10 Jan 2018 15:56:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w0A6uM2l020629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1515567385; bh=kov1RaOhmFeH+x92TYAwGwar3USzVtkZfrmfR/isIks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LWWTKf+BvbZdffVqTFzgIrIcDXLA01lFFL33CPpK9C+mUCHJU5RFuuXb0gK3XnY+G FXZ8ng1FDlVhX+FTt6CirB1/tp3rW6Eu8H18xs6NAOvW2LexpYqd6tvitb6PpeYw3p ikhEjhMMsg7xh/2Juv0fGXaW7rDujpOxTZFPdayF3PwATJ7+pyy88x0fnh3xPNP20W Y5Udm0tiSTTJx3JM9JxqCr+l3TStgbxieuFtOBnqJyaBa59W0q+N1zaNuY1Td1jBYQ rzckndN9/hUAXbYFJaMzc2BtK6XfkyZQMEyS9kCVlTSfEB7aecwTPpN86iHs+TvKJd tQoUPFPtC2+vg== 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 3/6] kconfig: do not call conf_set_all_new_symbols() for (all)defconfig Date: Wed, 10 Jan 2018 15:56:11 +0900 Message-Id: <1515567374-12722-3-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 (all)defconfig does not need to call conf_set_all_new_symbols() because conf_write() calculates all symbols based on their default unless they have been user-defined. conf_set_all_new_symbols(def_default) is no-op except for "choice". It calls sym_cal_value() for "choice", but the SYMBOL_VALID is cleared by set_all_choice_values() later on. So, conf_write() will re-calculate it, which is just a wasteful computation. The only difference I see is SYMBOL_DEF_USER flag for "choice", but it gives no difference to the resulted .config file. I confirmed this change still produced the same .config for all ARCH. I also moved savedefconfig to collect the no-op cases at the end of the switch statement. Signed-off-by: Masahiro Yamada --- scripts/kconfig/conf.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 52cbe5d..8364811 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -655,18 +655,10 @@ int main(int ac, char **av) case allmodconfig: conf_set_all_new_symbols(def_mod); break; - case alldefconfig: - conf_set_all_new_symbols(def_default); - break; case randconfig: /* Really nothing to do in this loop */ while (conf_set_all_new_symbols(def_random)) ; break; - case defconfig: - conf_set_all_new_symbols(def_default); - break; - case savedefconfig: - break; case oldaskconfig: rootEntry = &rootmenu; conf(&rootmenu); @@ -681,7 +673,10 @@ int main(int ac, char **av) check_conf(&rootmenu); } while (conf_cnt && input_mode != listnewconfig); break; + case alldefconfig: + case defconfig: case olddefconfig: + case savedefconfig: default: break; }