Received: by 10.213.65.68 with SMTP id h4csp311548imn; Mon, 26 Mar 2018 22:38:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELsBgbaSqv2x6Wp4ErC6L0VbySYllJVtzwMz5Y4SVwuEjUfA2/uHdo3gy+PMw9FFor8Kas4N X-Received: by 2002:a17:902:6941:: with SMTP id k1-v6mr25139529plt.185.1522129112151; Mon, 26 Mar 2018 22:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522129112; cv=none; d=google.com; s=arc-20160816; b=W3zye/gLaGdeJlWAdMkUd5HQFKWc5pC+v3nHSi2pvzoG4kRNKjW+kOO06rKmm5WVl0 rfmmd0rvgo9j3ujtsZw1XOGeqjr5Ar8xF4sqx/Yi18e407bAg3erxqsNMxn5cfhQEQ9e sNo13RZxKxY6MGfZUBElVCtVu0vU8c1wtM1OS9z9AIATO0WtP75fLdYt+TrbrdpYyCyL eroExsUpzMd0VNXl63T9zzqpPoGidfrusD/ULHvhEGCDjXAoKvp0Bf1gxcCrKwXzoq9a K06lqFhymylPLhY/PUgq32s78UAySP1j5ENMwRm4DFzrNX8UWqJVCOALFazT/pQUEMDc PW4g== 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=DJg7hGbemINDwGQx8+jEc01G97qTOgH9soG1HjzbY7o=; b=KbSp0+yAk75vw+Jp/c0dvatHqLVuNRinjIrrCjz29E/Dzev7VBzbGkBn1neaj1Aqg9 izpsJXFdAAOCafwDVwUywQMNXYb6UQkLZYLeI7RJViZZRP5KEsrZHxW0kQ2O9aoWOM55 0Q6VwzfUPjhsaThiHDOoFB1Sc5XIgImD0dbRsJWOthWt1jeoGdLRcZckip+uOvbifG7Y m8sT7n20iLmta80OnlcPs1DO+bzDVOy3jERgnhyscxHDN55IlZfHzZqYdkni1445EWdK jgabSyDqqGL99B1gLqIdOME8lNqHpTTI7YR+S3ycJ4cicCTMiHpKgDmrp7mRSRy2nvua F8DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HCz6Rh5M; 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 o61-v6si495165pld.646.2018.03.26.22.38.18; Mon, 26 Mar 2018 22:38:32 -0700 (PDT) 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=HCz6Rh5M; 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 S1752536AbeC0Fga (ORCPT + 99 others); Tue, 27 Mar 2018 01:36:30 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:44598 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbeC0FcA (ORCPT ); Tue, 27 Mar 2018 01:32:00 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w2R5TaLp011947; Tue, 27 Mar 2018 14:29:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w2R5TaLp011947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1522128585; bh=DJg7hGbemINDwGQx8+jEc01G97qTOgH9soG1HjzbY7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HCz6Rh5MUbl5/X4lCrIedMGioG8qXrHxEktq/QinIMlbdbJ7sRuTEW+gvoTRubSXA g2zwFY46hOkEXofC8rbjm8qpqhRpnRUbq+wKF+Uf0F2yh8Cs8dxOxNZvbWx2xgdomR gsAXvJqXpVjmlnXrLSf5U+2J6/TpZLjmiUWv9CkGHwQwHYV2f4niUNO0Sf4I6zJPHr qF84iGodnZGKOevjHwgLA95Kei/WlpBSTcd68Cs/esyTDyuRrFMtyl0kuA6s72dreE 0uu/C3xcSPvl+4lSmrV1wHn6QvGvaGZ3S/GNBSVvLAhDQFKq8eGJsl2RiilarriL8k MJ6gr5RdvJqPg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Ulf Magnusson , Kees Cook , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 06/21] kconfig: remove string expansion for mainmenu after yyparse() Date: Tue, 27 Mar 2018 14:29:20 +0900 Message-Id: <1522128575-5326-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> References: <1522128575-5326-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 Now that environments are expanded in the lexer, conf_parse() does not need to explicitly expand $ARCH and $KERNELVERSION in the mainmenu. The hack introduced by commit 0724a7c32a54 ("kconfig: Don't leak main menus during parsing") can go away. Signed-off-by: Masahiro Yamada --- Changes in v2: - Simplify the patch. Just remove the text expansion. scripts/kconfig/zconf.y | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 4ff4ac9..d8120c7 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -109,7 +109,7 @@ static struct menu *current_menu, *current_entry; %% input: nl start | start; -start: mainmenu_stmt stmt_list | no_mainmenu_stmt stmt_list; +start: mainmenu_stmt stmt_list | stmt_list; /* mainmenu entry */ @@ -118,19 +118,6 @@ mainmenu_stmt: T_MAINMENU prompt nl menu_add_prompt(P_MENU, $2, NULL); }; -/* Default main menu, if there's no mainmenu entry */ - -no_mainmenu_stmt: /* empty */ -{ - /* - * Hack: Keep the main menu title on the heap so we can safely free it - * later regardless of whether it comes from the 'prompt' in - * mainmenu_stmt or here - */ - menu_add_prompt(P_MENU, xstrdup("Linux Kernel Configuration"), NULL); -}; - - stmt_list: /* empty */ | stmt_list common_stmt @@ -528,7 +515,6 @@ word_opt: /* empty */ { $$ = NULL; } void conf_parse(const char *name) { - const char *tmp; struct symbol *sym; int i; @@ -544,10 +530,10 @@ void conf_parse(const char *name) if (!modules_sym) modules_sym = sym_find( "n" ); - tmp = rootmenu.prompt->text; - rootmenu.prompt->text = _(rootmenu.prompt->text); - rootmenu.prompt->text = expand_string_value(rootmenu.prompt->text); - free((char*)tmp); + if (!menu_has_prompt(&rootmenu)) { + current_entry = &rootmenu; + menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + } menu_finalize(&rootmenu); for_all_symbols(i, sym) { -- 2.7.4