Received: by 10.213.65.68 with SMTP id h4csp94496imn; Mon, 19 Mar 2018 21:00:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELtbnC2R5RAA33aKvZOKrorZIAM0fdC5Kmou1fvHRcpsuvu9cd1lcqlrdDlfLkQE6Bm6A6mf X-Received: by 10.99.116.30 with SMTP id p30mr10987871pgc.60.1521518418934; Mon, 19 Mar 2018 21:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521518418; cv=none; d=google.com; s=arc-20160816; b=Ry7Ln9u8zLnki1IsBcCeBxUMrs+2RDFn1vCLoG7fsh6PaMb8Xu3ZggH1U3ICFdcw+m bnr9ze0dVF8UqYxCmz+yC9CMSsrl+raOUnAIK/KXJxv1cRfmi+MEm83eDSPLsxpFj9gP Ea5NrV5O/pWgPjS2Pslhnsi1ycQ2uifRgSDkt3fmfTd0f5eMjjdKRLiE+YougrhsEwhC XjRETHkujP4v37jTh5IbLlJF/fi94VrIAEnqQCdEeQuppaRGcj07JJzivma5FLn6yTvm GuJ0quLuIvFa5MFgd5W8A5QG9IQNVaTXSNw3Gq0lQ2uMqwsjFoQLPp6ghcmfQe011Z2u IQPQ== 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:dkim-filter :arc-authentication-results; bh=Iz4+Rw7f36YuPRSXV+zuQvJ57xW86v3w6pPrwfVcFDw=; b=Oi8UUa2s39FtEKcCLsgMmgEhLJ3g6U1RDe/5wENOaHOkVFDIZ1vZBP65zKqKTs43bf Dd+IwKxGlF9fRVzO/4C+/V86szk90OeQQeL/ANNl8LCgzBqHpQSISlAkHIw9EX05EnLd +e2TpnosbrPDJOVFudkE2oGPf/SftQhuQXDygeCh0jE230riWqBTxDWgsvstDamT8KQQ udVoEJsaTLtuq+ZfqGi70chMEPQcw6LrhlQ6Zh9qMc8b9m2HFGmzTOdE2J+MCYQEP96M qbzsWMkxZwMmTTrRlv3oqQvXVmZPAvv6SB6TDGJufRa54nEXtoEMoBvDDXwYIYhXKKTz /+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rVwvQegF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 99-v6si777811plf.56.2018.03.19.21.00.01; Mon, 19 Mar 2018 21:00:18 -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=@nifty.com header.s=dec2015msa header.b=rVwvQegF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbeCTD6r (ORCPT + 99 others); Mon, 19 Mar 2018 23:58:47 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:26525 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbeCTD6n (ORCPT ); Mon, 19 Mar 2018 23:58:43 -0400 Received: from mail-ua0-f176.google.com (mail-ua0-f176.google.com [209.85.217.176]) (authenticated) by conssluserg-05.nifty.com with ESMTP id w2K3wRix022236; Tue, 20 Mar 2018 12:58:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com w2K3wRix022236 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521518308; bh=Iz4+Rw7f36YuPRSXV+zuQvJ57xW86v3w6pPrwfVcFDw=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=rVwvQegFirBQ7myd8k0dKD2+8h9d+r0uCTsn0ZrHbSgyaVjhkKEfWgPIvb8bNPabu mUUZ1qOXq1q90W2vDpWfiftPWsvPktQmSgopBTIG/AgqbZswcm48KHk8DPtpfHkXeX 7f1NdJ+0lXJGoHpmL62xw7/eOOqd9cekmpbtyd5WEnpzOL/OvUoZbQi4vIoMECzUNr +ELB8SyQlDGkJ9V7pb4+jaZFx2sYF5dEMuzJ1iOOhax1lvZvF+TlK5Oa6Yzm2qexSI p6DAfGhgBUPLuEWPuJGiMX8AlwpwSF94JeBbXpQNrjPLkz8Cik2AX13CXh0ExYVRCq /tJLj+JkP7NNg== X-Nifty-SrcIP: [209.85.217.176] Received: by mail-ua0-f176.google.com with SMTP id t29so167145uae.1; Mon, 19 Mar 2018 20:58:28 -0700 (PDT) X-Gm-Message-State: AElRT7EOMHXzMo0RWnAdWtihRvJac4ghoZzOnl2Osk9OxXJ5/ddiK0NS KV/6mn186XNktxMyoqZBH37p8F/E6RmRuzSFQM0= X-Received: by 10.159.58.88 with SMTP id r24mr3364997uag.140.1521518307226; Mon, 19 Mar 2018 20:58:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.53.175 with HTTP; Mon, 19 Mar 2018 20:57:46 -0700 (PDT) In-Reply-To: <20180318221737.GA25547@example.com> References: <1520934968-30406-1-git-send-email-yamada.masahiro@socionext.com> <20180318221737.GA25547@example.com> From: Masahiro Yamada Date: Tue, 20 Mar 2018 12:57:46 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/2] kconfig: warn unmet direct dependency of tristate symbols selected by y To: Eugeniu Rosca Cc: Linux Kbuild mailing list , Sam Ravnborg , Ulf Magnusson , Randy Dunlap , "Luis R . Rodriguez" , Petr Vorel , Eugeniu Rosca , Linux Kernel Mailing List 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 2018-03-19 7:17 GMT+09:00 Eugeniu Rosca : > Hi Masahiro, > > On Tue, Mar 13, 2018 at 06:56:07PM +0900, Masahiro Yamada wrote: >> Commit 246cf9c26bf1 ("kbuild: Warn on selecting symbols with unmet >> direct dependencies") forcibly promoted ->dir_dep.tri to yes from mod. >> So, the unmet direct dependencies of tristate symbols are not reported. >> >> [Test Case] >> >> config MODULES >> def_bool y >> option modules >> >> config A >> def_bool y >> select B >> >> config B >> tristate "B" >> depends on m >> >> This causes unmet dependency because 'B' is forced 'y' ignoring >> 'depends on m'. This should be warned. >> >> On the other hand, the following case ('B' is bool) should not be >> warned, so 'depends on m' for bool symbols should be naturally treated >> as 'depends on y'. >> >> [Test Case2 (not unmet dependency)] >> >> config MODULES >> def_bool y >> option modules >> >> config A >> def_bool y >> select B >> >> config B >> bool "B" >> depends on m >> >> Signed-off-by: Masahiro Yamada >> --- >> >> Changes in v4: >> - newly added >> >> >> scripts/kconfig/symbol.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c >> index 0f7eba7..def860b 100644 >> --- a/scripts/kconfig/symbol.c >> +++ b/scripts/kconfig/symbol.c >> @@ -243,7 +243,7 @@ static void sym_calc_visibility(struct symbol *sym) >> tri = yes; >> if (sym->dir_dep.expr) >> tri = expr_calc_value(sym->dir_dep.expr); >> - if (tri == mod) >> + if (sym->type == S_BOOLEAN && tri == mod) > > This seems to be very close to one of the issues fixed in the old > v2.6.5 commit 5a87d187fce1 ("[PATCH] config: choice fix") accessible at > https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?h=5a87d187fce1 > > IMHO you could probably use (not tested!): > + if (tri == mod && sym_get_type(sym) == S_BOOLEAN) > > instead of > + if (sym->type == S_BOOLEAN && tri == mod) > > to be consistent with the rest of sym_calc_visibility(). I tested it, and probably OK. I will squash the diff. Thanks. > Also, since after this commit there will be a great amount of symmetry > between how dirdep/revdep/weak-revdep are calculated inside > sym_calc_visibility(), somebody could probably unify the implementations > in future (not subject of this patch). > >> tri = yes; >> if (sym->dir_dep.tri != tri) { >> sym->dir_dep.tri = tri; >> @@ -414,7 +414,7 @@ void sym_calc_value(struct symbol *sym) >> } >> } >> calc_newval: >> - if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { >> + if (sym->dir_dep.tri < sym->rev_dep.tri) { > > Looks good. > >> struct expr *e; >> e = expr_simplify_unmet_dep(sym->rev_dep.expr, >> sym->dir_dep.expr); >> -- >> 2.7.4 >> > > Best regards, > Eugeniu. > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards Masahiro Yamada