From patchwork Tue Aug 2 22:40:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniu Rosca X-Patchwork-Id: 9260465 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 50B25608A1 for ; Tue, 2 Aug 2016 22:40:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E14A284E2 for ; Tue, 2 Aug 2016 22:40:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3301B284EF; Tue, 2 Aug 2016 22:40:58 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 C845628520 for ; Tue, 2 Aug 2016 22:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754915AbcHBWkv (ORCPT ); Tue, 2 Aug 2016 18:40:51 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36243 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756708AbcHBWkq (ORCPT ); Tue, 2 Aug 2016 18:40:46 -0400 Received: by mail-wm0-f65.google.com with SMTP id x83so33332150wma.3; Tue, 02 Aug 2016 15:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=9qtHZadO3ocrDUC7K7wOsT2sGVjJeIdumT6cwgjunfM=; b=AB6vh6u8tbfssa3FxcyvXvd2wRKiqQP2/kuqpa6W0lowXog6mOpPdpYq5ctg7Iuq4j X0CKuj6Cjm3C6kuQaPdKW3ij9MJpHWw8GxKHfjAFUWnmQcHNqBBmscwkYnzbKh9YejPF o/j3QMTW07Z3GBm+jxl/yLRkn8quKfSbrm8yI8N6jZ4OtxadgrxXQk9Hj2EE3balqr9N ES2g8NYUjF2J1CWmhlkV4bgBYG3zwCRRJMEuVEbKvmQ9GEI55Wf3NWHFTCv94oFfL+Vr +E8tGIdFanW+B9kJwnJz+0zut0gxPslTqCImNLOZ+TO1SLhKhkADTp6fV85/4rs1wa4H vdFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=9qtHZadO3ocrDUC7K7wOsT2sGVjJeIdumT6cwgjunfM=; b=K2tsJ+SRzQD0h0SN7YPwdEwHK5jjNGIWkmkUcMpIGBQmjAiqrPEmm9AebMnFkgLaaF 5aZpIrpG90+UE6kX89dGUyQW24r6PkxQqZagblVyZ9ZJP1g72PjBDX8LDOdOtCtfhCSx Vw7FnrQZvkVOocMA4EjsuPxB97gG0h/kmObl7MVYv69zRjfRozzbVBsqg0xhT1o2APMH pVlAg+ZoHm+m3M/VBjcDK50wHOJqnET5rUj07yrQeRZRygQnji03+6gNPdxJZXbm5ahb mKBdOILZ0XwK1i9C8kCiup8ymLAK3JXcREs7avD1W7YUimKylscP/uxfxUEmx39z+eao yQQw== X-Gm-Message-State: AEkooutsrMFFMIGgMbyj/6xhDnXz1RnODK/i7B9Qsd6oMvU4o/ez+8QLF7RYfdHb3jjDYQ== X-Received: by 10.194.148.81 with SMTP id tq17mr57264464wjb.67.1470177637794; Tue, 02 Aug 2016 15:40:37 -0700 (PDT) Received: from eugeniu-X230 (x55b33c37.dyn.telefonica.de. [85.179.60.55]) by smtp.gmail.com with ESMTPSA id o4sm4626276wjd.15.2016.08.02.15.40.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Aug 2016 15:40:36 -0700 (PDT) From: Eugeniu Rosca X-Google-Original-From: Eugeniu Rosca Date: Wed, 3 Aug 2016 00:40:34 +0200 To: yann.morin.1998@free.fr, mmarek@suse.com, corbet@lwn.net, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org Cc: rosca.eugeniu@gmail.com Subject: [PATCH] kconfig-language: improve menuconfig usage description Message-ID: <20160802224034.GA30411@eugeniu-X230> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) 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 Improper menuconfig usage leads to empty menu entries. zconfdump() is able to reveal some real-life examples: - menuconfig VFIO_NOIOMMU - menuconfig RESET_CONTROLLER - menuconfig SND_ARM To avoid future occurrences of those, improve the menuconfig syntax description. Signed-off-by: Eugeniu Rosca --- Documentation/kbuild/kconfig-language.txt | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index db10185..069fcb3 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt @@ -274,7 +274,44 @@ menuconfig: This is similar to the simple config entry above, but it also gives a hint to front ends, that all suboptions should be displayed as a -separate list of options. +separate list of options. To make sure all the suboptions will really +show up under the menuconfig entry and not outside of it, every item +from the list must depend on the menuconfig symbol. +In practice, this is achieved by using one of the next two constructs: + +(1): +menuconfig M +if M + config C1 + config C2 +endif + +(2): +menuconfig M +config C1 + depends on M +config C2 + depends on M + +In the following examples (3) and (4), C1 and C2 still have the M +dependency, but will not appear under menuconfig M anymore, because +of C0, which doesn't depend on M: + +(3): +menuconfig M + config C0 +if M + config C1 + config C2 +endif + +(4): +menuconfig M +config C0 +config C1 + depends on M +config C2 + depends on M choices: