Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755283AbeAOLAw (ORCPT + 1 other); Mon, 15 Jan 2018 06:00:52 -0500 Received: from mail-ua0-f195.google.com ([209.85.217.195]:33936 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755129AbeAOLAu (ORCPT ); Mon, 15 Jan 2018 06:00:50 -0500 X-Google-Smtp-Source: ACJfBosww9EN2uQ2R6dMxGF5D/JAvUyZQi2Q58buKSrnnZO4mzfKimgHok/06+6iClVYcX3iyvx5ksw+yS9VA+srsro= MIME-Version: 1.0 In-Reply-To: <20180114210048.GA11442@ravnborg.org> References: <20180114113345.18623-1-ulfalizer@gmail.com> <20180114210048.GA11442@ravnborg.org> From: Ulf Magnusson Date: Mon, 15 Jan 2018 12:00:48 +0100 Message-ID: Subject: Re: [PATCH 0/2] kconfig: 'if' and automatic submenu creation documentation To: Sam Ravnborg Cc: Linux Kbuild mailing list , Masahiro Yamada , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sun, Jan 14, 2018 at 10:00 PM, Sam Ravnborg wrote: > Hi Ulf. > > On Sun, Jan 14, 2018 at 12:33:43PM +0100, Ulf Magnusson wrote: >> These together should make the automatic submenu logic a lot clearer. >> >> Ulf Magnusson (2): >> kconfig: Document 'if' flattening logic >> kconfig: Improve auto. menu documentation accuracy >> >> scripts/kconfig/menu.c | 33 +++++++++++++++++++++++++++++---- >> 1 file changed, 29 insertions(+), 4 deletions(-) > > Very good with extra comments in menu_finalize. > If you can mamage to explain the logic related to select > then even better. I added a short comment in https://patchwork.kernel.org/patch/9986947/, which is already in linux-next: /* * Handle selects and implies, which modify the * dependencies of the selected/implied symbol */ if (prop->type == P_SELECT) { ... There's also https://patchwork.kernel.org/patch/9983881/: /* Reverse dependencies through being selected by other symbols */ struct expr_value rev_dep; I guess it could be made more explicit. I don't want to heap on too many patches at once though. > > While on the subject on improving readability, then > menu_finalize would benefit from a split in a number of > well named and well documented helper functions. > > It would be great if you could try this out. I had a stab at it earlier, but never got done. I think the high-level structure in Kconfiglib should work: https://github.com/ulfalizer/Kconfiglib/blob/master/kconfiglib.py#L3990 Hopefully I'll get back to it later once the current batch of patches has been merged. I'm just happy to have to have less mystery code in there for now. Definitely one of the more opaque parts of Kconfig. Cheers, Ulf