From patchwork Sun Oct 8 22:14:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Magnusson X-Patchwork-Id: 9992029 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 00D9760230 for ; Sun, 8 Oct 2017 22:15:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E25462861A for ; Sun, 8 Oct 2017 22:15:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5A0C2861D; Sun, 8 Oct 2017 22:15:14 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 70ABE2861A for ; Sun, 8 Oct 2017 22:15:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751001AbdJHWPM (ORCPT ); Sun, 8 Oct 2017 18:15:12 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:50749 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbdJHWPL (ORCPT ); Sun, 8 Oct 2017 18:15:11 -0400 Received: by mail-lf0-f67.google.com with SMTP id a132so17321475lfa.7; Sun, 08 Oct 2017 15:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+sEJImYUKS0MpU2CAHUzf+GCkX2TZwdZ3XiHrbYMRaY=; b=NvAnb/fCbCS3N7Za0VHWBo8IT0FAjScZRRvhl62P91fqd5usPu9eQWpfHD8CQXW3X1 mtCZMtCDc183P1gLvU6+Lhghmj0XulPw1TSbTTycqMsJcOyrCQS7bdsUqWU74iX9bIuW NygN1rC81GnlRNCIFi+DlsPiZwAhnhvhjPobmm2vqoWiZDHLJT42jrr6n/B324Pfbn4x OY1ZwYKZ/taDQOBlEFkNiDCwDp0j5trxegHvkPVkNtn3VLu8anAQr6pky4XRF5/+vlSl vgYrmw/P+FkE+h8OzZTJTm7onhgvk/5Cc7gQGQjbz/YEmQZJNFSlgLhcJb41OzlvEl10 a87Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+sEJImYUKS0MpU2CAHUzf+GCkX2TZwdZ3XiHrbYMRaY=; b=ik1PaWp5f/4dvL9oJ8GnY2PgdJo1ADCvpyDD9xVAObzW/3n7QZGmcsQ1Rm1suk7Vpv I67R8NbiT7g/coBphfTIj8YtDnrPJWwK1MxjeRgZ38DG+79nIihBFF7Q936Wl3Vj+XbB WIPOhooIF7wybA8zNqHvomRSqTcSPyUIx1I1howQFCzbxi8xN+J37GoWnfVQV1QiQjbk GTgj94k9O9C1rvMKmT+TCCwDqvGwEAYFP11OUUAzbxXDp40o/r0+FHUh39moBgc12AxH kLnGom/zs7fhm+ckoDWza7Ky+5X5ntxgDQ9DEkAElh6Npz8PuZh3VUW3ZzUVlQ2O2fsF FJWQ== X-Gm-Message-State: AMCzsaW0EJ9NTpfx9WCyvVV0Y1Gzdp0VflTeCyx5LbwTH0TSTugqIa33 S+J6YVX/IQv1NO8IpA5B42U= X-Google-Smtp-Source: AOwi7QBHEu6se5yDcH92XccGfGVl1AVM3aHxc2+sVBMygNYOiZlwVBnmMtr6VIOPKvOE6g3/SckQTg== X-Received: by 10.25.242.65 with SMTP id d1mr2894442lfk.82.1507500910023; Sun, 08 Oct 2017 15:15:10 -0700 (PDT) Received: from huvuddator.lan (ua-213-112-0-22.cust.bredbandsbolaget.se. [213.112.0.22]) by smtp.gmail.com with ESMTPSA id 84sm1398365lja.83.2017.10.08.15.15.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Oct 2017 15:15:09 -0700 (PDT) From: Ulf Magnusson To: yann.morin.1998@free.fr, linux-kbuild@vger.kernel.org Cc: sam@ravnborg.org, zippel@linux-m68k.org, nicolas.pitre@linaro.org, michal.lkml@markovi.net, dirk@gouders.net, yamada.masahiro@socionext.com, lacombar@gmail.com, JBeulich@suse.com, linux-kernel@vger.kernel.org, Ulf Magnusson Subject: [PATCH v2] kconfig: Remove menu_end_entry() Date: Mon, 9 Oct 2017 00:14:48 +0200 Message-Id: <1507500888-6515-1-git-send-email-ulfalizer@gmail.com> X-Mailer: git-send-email 2.7.4 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 menu_end_entry() is empty and completely unused as far as I can tell: $ git log -G menu_end_entry --oneline a02f057 [PATCH] kconfig: improve error handling in the parser 1da177e Linux-2.6.12-rc2 Last one is the initial Git commit, where menu_end_entry() is empty as well. I couldn't find anything that redefined it on Google either. It might be a debugging helper for setting a breakpoint after each config, menuconfig, and comment is parsed. IMO it hurts more than it helps in that case by making the parsing code look more complicated at a glance than it really is, and I suspect it doesn't get used much. Tested by running the Kconfiglib test suite, which indirectly verifies that the .config files generated by the C implementation for each defconfig file in the kernel stays the same. Signed-off-by: Ulf Magnusson --- Changes in v2: - Don't include the regenerated parser. It wouldn't be safe to pull it directly from the patch if other changes go in before, and it might cause unnecessary merge conflicts. Regenerate it manually instead: $ make REGENERATE_PARSERS=1 conf scripts/kconfig/lkc.h | 1 - scripts/kconfig/menu.c | 5 ----- scripts/kconfig/zconf.y | 6 +----- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index cdcbe43..16cb62b 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -100,7 +100,6 @@ void menu_warn(struct menu *menu, const char *fmt, ...); struct menu *menu_add_menu(void); void menu_end_menu(void); void menu_add_entry(struct symbol *sym); -void menu_end_entry(void); void menu_add_dep(struct expr *dep); void menu_add_visibility(struct expr *dep); struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index e935793..503f3ae 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -62,13 +62,8 @@ void menu_add_entry(struct symbol *sym) menu_add_symbol(P_SYMBOL, sym, NULL); } -void menu_end_entry(void) -{ -} - struct menu *menu_add_menu(void) { - menu_end_entry(); last_entry_ptr = ¤t_entry->list; return current_menu = current_entry; } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index c8f396c..3845aa9 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -155,7 +155,6 @@ config_entry_start: T_CONFIG T_WORD T_EOL config_stmt: config_entry_start config_option_list { - menu_end_entry(); printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); }; @@ -173,7 +172,6 @@ menuconfig_stmt: menuconfig_entry_start config_option_list current_entry->prompt->type = P_MENU; else zconfprint("warning: menuconfig statement without prompt"); - menu_end_entry(); printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); }; @@ -406,9 +404,7 @@ comment: T_COMMENT prompt T_EOL }; comment_stmt: comment depends_list -{ - menu_end_entry(); -}; +; /* help option */