From patchwork Wed Sep 4 10:59:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 2853603 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ECCE0C0AB5 for ; Wed, 4 Sep 2013 11:00:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7D46200F2 for ; Wed, 4 Sep 2013 11:00:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF0EE200EC for ; Wed, 4 Sep 2013 11:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757154Ab3IDK72 (ORCPT ); Wed, 4 Sep 2013 06:59:28 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:57951 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762398Ab3IDK71 (ORCPT ); Wed, 4 Sep 2013 06:59:27 -0400 Received: by mail-wi0-f181.google.com with SMTP id c10so156913wiw.2 for ; Wed, 04 Sep 2013 03:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=DJp8jklksjVZuMwScdd5CkHtS4kAt8Ki8b1gopUbmGc=; b=u8Ho5R99w2v35Mor3OYNbaFfABlgiPuRBFh4OgiLPmfHEtuYXr2+vc76EBucSRMi7c E7oTqlcVYxt/D//Q9ERa08Q+LXTh+C4/PoEExiT759be7TIZk6vybLHErGYUlK64AKgW 7TLXTrB5Rwk25w2rjorlw9E2htSct9pIDXrXumU8s4cRZnOR9B3dKusuz3ZYQnZIcVJ+ g4l1XctVgCc1wBzkkzqsNG33v5Qk7/AzZGenLQtOdDoEpInt2vLR+7+OcXpJAs8imIvj qR4VqtyksfqI8uYgLQ72pfjQe4aXAA7IA0spzwzCINEgvvO3JpT0YVMD8gO0wpnKFdzL DIJg== X-Received: by 10.180.188.202 with SMTP id gc10mr1659705wic.3.1378292366244; Wed, 04 Sep 2013 03:59:26 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id p8sm3104884wij.8.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 03:59:25 -0700 (PDT) From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , linux-kernel@vger.kernel.org, Sam Ravnborg , "Yann E. MORIN" Subject: [PATCH 1/3] kconfig: do not special-case 'MODULES' symbol Date: Wed, 4 Sep 2013 12:59:15 +0200 Message-Id: X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Yann E. MORIN" Currently, the 'MODULES' symbol is hard-coded to be the default symbol that enables/disables tristates, if no other symbol was declared with 'option modules'. While this used to be needed for the Linux kernel, we now have an explicit 'option modules' attached to the 'MODULES' symbol (since cset 11097a036), so we no longer need to special-case it in the kconfig code. Furthermore, kconfig is extensively used out of the Linux kernel, and other projects may have another meaning for a symbol named 'MODULES'. This patch changes the way we enable/disable tristates: if a symbol was found with 'option modules' attached to it, then that symbol controls enabling tristates. Otherwise, tristates are disabled, even if a symbol named 'MODULES' exists. Signed-off-by: "Yann E. MORIN" Cc: Sam Ravnborg Cc: Michal Marek --- scripts/kconfig/menu.c | 5 +---- scripts/kconfig/zconf.y | 11 ++--------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 7e233a6..3a9c674 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -197,12 +197,9 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) void menu_add_option(int token, char *arg) { - struct property *prop; - switch (token) { case T_OPT_MODULES: - prop = prop_alloc(P_DEFAULT, modules_sym); - prop->expr = expr_alloc_symbol(current_entry->sym); + modules_sym = current_entry->sym; break; case T_OPT_DEFCONFIG_LIST: if (!sym_defconfig_list) diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 864da07..0653886 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -493,9 +493,6 @@ void conf_parse(const char *name) sym_init(); _menu_init(); - modules_sym = sym_lookup(NULL, 0); - modules_sym->type = S_BOOLEAN; - modules_sym->flags |= SYMBOL_AUTO; rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); if (getenv("ZCONF_DEBUG")) @@ -503,12 +500,8 @@ void conf_parse(const char *name) zconfparse(); if (zconfnerrs) exit(1); - if (!modules_sym->prop) { - struct property *prop; - - prop = prop_alloc(P_DEFAULT, modules_sym); - prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); - } + if (!modules_sym) + modules_sym = sym_find( "n" ); rootmenu.prompt->text = _(rootmenu.prompt->text); rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);