Received: by 10.223.164.221 with SMTP id h29csp119958wrb; Wed, 4 Oct 2017 20:14:05 -0700 (PDT) X-Received: by 10.99.149.73 with SMTP id t9mr14617859pgn.174.1507173245819; Wed, 04 Oct 2017 20:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507173245; cv=none; d=google.com; s=arc-20160816; b=gdj4w4LJPxOyuUQPmpXel2DZ7KxFoQe40+eWkpp+XGpCIfVlbE7VpK8EaF5zFQAXVh QFJA099/OcG3HoIMQz05FLimLS2lP98CNOwptqtTF14hC2oY9ImINPdFfMa1nJeUE05b NPN9ZC1admigU5sbd3HJ7lcr/5gpJnwRBTUjoIXy6UMC30/ldBO6nLKSCuRcSEGL9FmK ZWan1FViA4fRp0CLpfB55+1soPeQHrdRTmB10R7ZXfsz0iMx7gc5ylPgjy/3VvgjI0r7 iCn1H2h9nDhmhvLFmR0mmGHtWIzdPd9aQF/3dYK35hIns8EL1+hPPgfVCQriLkna193z Y9Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=cqjZbZueKklcoucgEtBuA6lGISKAr9LPQ+rKk+dPQaA=; b=Ql8bN3dtiMInEnxl0DeKi+hHNW3vLs9Rvg993Fkp8x4VVdLIyFV2Z9HuhDQzBGwVn9 hlVz6bimKlyg//JafwvoHSdflpqTc4jMxXl6VOGpNkUbJbbViL8POuUFQ7+C+uN6v+ui pO/9Tgpu1UK6l6H6a8puHjgDeImR4N77GNIlReXv6nAXXh/t0zzxpvnD/xRRtNolH+dV rLpNyqLAOgBlaFT5DHIKTi977rnfrh2TA/SMiPM3VboBCJnckJj/FYPYl6x1yIMDI2QN O7+SaOXFTnOb/DsfzLs9Xjlb0be35Oq5OsIpi1Cj6Al/+EwVAY8M3002UAf/IYshseRI qj1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=me867hSN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si9223715pgo.439.2017.10.04.20.13.52; Wed, 04 Oct 2017 20:14:05 -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=@gmail.com header.s=20161025 header.b=me867hSN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdJEDN2 (ORCPT + 99 others); Wed, 4 Oct 2017 23:13:28 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:36097 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260AbdJEDN0 (ORCPT ); Wed, 4 Oct 2017 23:13:26 -0400 Received: by mail-vk0-f67.google.com with SMTP id w23so3954584vkw.3; Wed, 04 Oct 2017 20:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cqjZbZueKklcoucgEtBuA6lGISKAr9LPQ+rKk+dPQaA=; b=me867hSNQFZIr5hHIFcEl9O4wbx8rkyPJBxF33ssgM5tygJVxv20vhwmXA64qAuHud La123K5RJFBlluLdYYkxvyKAEHVQArtlUqtZcQlry9knSZIZK2P9lXalWbWk41PvyCNP wrHMKYurvLMt2tSiIZmoPMkKFrNf89FM5nK//2ragbzCaBzWpf4r39jAe5AEXOBVyhei l3SKWZ5du7+woFeyd+UMwCJ9ERqCNh051r+BSLVfc0XKfVwVPc21MwspeA2EAg0uuXn1 0Q0nMK4Sl8Prr77Wnu+Cfq5LG1BU+E5JAbmqx22+JBmznp2v03u/MMSbF8BFhAKMq05r dX4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cqjZbZueKklcoucgEtBuA6lGISKAr9LPQ+rKk+dPQaA=; b=k84w8hJy3caWlNjKLoxHk//HqepYhY50cClate6DrL1jzkSuNYsQDrWT/FDT3yHuzN e5BCjp1CW2oYOgCViQxv+HjtszxBErxwXkz19+uKOo2OKRHor08o0/gf//osB8+Ci4B6 TAWCnyAd8tLLSQ4BAaWj5Wj2SEzUW6Lm/T/4Yeh6CsTOP8IBl4EPZZb2MMuNWgXoNmP9 mEgeODmZVO8zaddYivqiRpVIJkEebTEtXNAllDpkmc/YcbXTFYE2N7kknuG6RQ5UCEPQ JwJrMuRs1abBAJpqTLPwCHSH8pr1tgpCN36wF1g7G1xKLLXAz81VRjDn04obMUIljE2S kUYg== X-Gm-Message-State: AMCzsaXuRir70q3JCChK863l54eFn2QtF0Wwiv6L9JWstz0ezzHCVe+B u7Wi2aKZVGDlx3vrCsWDEEn/JjVuw0Wjf9+iYvI= X-Google-Smtp-Source: AOwi7QDlCGbiKJt+WEVvr16N2w0pm749l171sh5fY7QyvLKLozt51h6jx3rKIR3//fGxkv/x4YmOjDHde41LZ0LIZsI= X-Received: by 10.31.128.149 with SMTP id b143mr11843255vkd.56.1507173205939; Wed, 04 Oct 2017 20:13:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.68.14 with HTTP; Wed, 4 Oct 2017 20:13:25 -0700 (PDT) In-Reply-To: <1507088232-8510-1-git-send-email-ulfalizer@gmail.com> References: <1507088232-8510-1-git-send-email-ulfalizer@gmail.com> From: Ulf Magnusson Date: Thu, 5 Oct 2017 05:13:25 +0200 Message-ID: Subject: Re: [PATCH] kconfig: Document the 'menu' struct To: yann.morin.1998@free.fr, linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ulf Magnusson , Masahiro Yamada , Arnaud Lacombe Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 4, 2017 at 5:37 AM, Ulf Magnusson wrote: > Understanding what it represents helps a lot when reading the code, and > it's not obvious, so document it. > > The ROOT_MENU flag is only set and tested by the gconf and qconf front > ends, so leave it undocumented here. The obvious guess for what it means > is correct. > > Signed-off-by: Ulf Magnusson > --- > scripts/kconfig/expr.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > > diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h > index a73f762..ae7583c 100644 > --- a/scripts/kconfig/expr.h > +++ b/scripts/kconfig/expr.h > @@ -166,22 +166,67 @@ struct property { > for (st = sym->prop; st; st = st->next) \ > if (st->text) > > +/* > + * Represents a node in the menu tree, as seen in e.g. menuconfig (though used > + * for all front ends). Each symbol, menu, etc. defined in the Kconfig files > + * gets a node. A symbol defined in multiple locations gets one node at each > + * location. > + */ > struct menu { > + /* The next menu node at the same level */ > struct menu *next; > + > + /* The parent menu node, corresponding to e.g. a menu or choice */ > struct menu *parent; > + > + /* The first child menu node, for e.g. menus and choices */ > struct menu *list; > + > + /* > + * The symbol associated with the menu node. Choices are implemented as > + * a special kind of symbol. NULL for menus, comments, and ifs. > + */ > struct symbol *sym; > + > + /* > + * The prompt associated with the node. This holds the prompt for a > + * symbol as well as the text for a menu or comment, along with the > + * type (P_PROMPT, P_MENU, etc.) > + */ > struct property *prompt; > + > + /* > + * 'visible if' dependencies. If more than one is given, they will be > + * ANDed together. > + */ > struct expr *visibility; > + > + /* > + * Ordinary dependencies from e.g. 'depends on' and 'if', ANDed > + * together > + */ > struct expr *dep; > + > + /* MENU_* flags */ > unsigned int flags; > + > + /* Any help text associated with the node */ > char *help; > + > + /* The location where the menu node appears in the Kconfig files */ > struct file *file; > int lineno; > + > + /* For use by front ends that need to store auxiliary data */ > void *data; > }; > > +/* > + * Set on a menu node when the corresponding symbol changes state in some way. > + * Can be checked by front ends. > + */ > #define MENU_CHANGED 0x0001 > + > #define MENU_ROOT 0x0002 > > struct jump_key { > -- > 2.7.4 > Adding some CCs just because I forgot. No panic. Cheers, Ulf From 1580296616715072859@xxx Wed Oct 04 03:38:15 +0000 2017 X-GM-THRID: 1580296616715072859 X-Gmail-Labels: Inbox,Category Forums