Received: by 10.223.185.116 with SMTP id b49csp4036868wrg; Tue, 6 Mar 2018 08:50:38 -0800 (PST) X-Google-Smtp-Source: AG47ELuG6da6uXR/tu+0jL2sWMvT4fxVaE07f9EVJXVTCCsNP9m0HdXQnp4i96vkthIEqxrKvZ3X X-Received: by 10.98.200.131 with SMTP id i3mr19661304pfk.40.1520355038100; Tue, 06 Mar 2018 08:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520355038; cv=none; d=google.com; s=arc-20160816; b=hyAQgR2l39ei2uWRjAFO5DJImPiUzJk1L3oqm9KJOMtU3xEIYOT4k+F0089It0wX6A BZz3AV43NciPENdOe///lUN38mSOZkPa0f9pkiY0dHHlcRMJmlYkL9/uILbUbzWjn0qQ phvlIxx+V9JZ3NnWoxmyzZvco7ruTh9vo5mvUvB+uJe+rWdRES+UyN/4ZundaZwVhWay FlnvfjYgOkm5d0UmvH81NZ2JsUMzKJes4B5y+1d2TJqV/+gpMEY/2uXofFI3oM3Fsq1j gKGR0fE6NWbfjxxmOxG74QHU+yG4eTHynuFAhNPeW3uvBEqu/HZw7NtGoEHjJMApB4zk P1jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature:arc-authentication-results; bh=eDzMtGsXQXBapViwWo6OHcz00vPxTv4m91Ufivn7QlE=; b=QLLLxLsOqNGo+fIn/v1xUvUh54YjiAhlgWZDGc1I9suw9Xx1JLewQOhF9EHOwGrP08 2kBx9DJqI4jwDycrJmT1rpYl9SQ0WkpxIOdqMt2e6aukbDaHRb01NfUFKVj1n1SuVXCv ZxcOr2GV6VJd/piZok8YMyh7WuKspoPgNWc8uZnHzF15gs/skE89Z+RCr0TOag9cqAfL xns150OmUoTqCIIxwZyHR+Ezvy83lefUayQWUE9XkBBIwO3WPjNSaqSWHfD3dDI90FNU 5IsaMo8GAUX9tx5niEbaVfmSuG7jThu7joubvs36PKATOMsUsYaedixdvbt2l8P90hgj m9sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pRjiPts4; 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=QUARANTINE 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 c15-v6si11263753plz.630.2018.03.06.08.50.23; Tue, 06 Mar 2018 08:50:38 -0800 (PST) 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=pRjiPts4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753560AbeCFQtW (ORCPT + 99 others); Tue, 6 Mar 2018 11:49:22 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:38619 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbeCFQtU (ORCPT ); Tue, 6 Mar 2018 11:49:20 -0500 Received: by mail-pf0-f194.google.com with SMTP id d26so8966039pfn.5; Tue, 06 Mar 2018 08:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eDzMtGsXQXBapViwWo6OHcz00vPxTv4m91Ufivn7QlE=; b=pRjiPts4Bp7UAGn/OO2usEye/37U8y+9b66JdyHBCOXu1nMd5M6W7hCHaBQDT966IZ mB3B+6Qb7LvAitxoLLLO4w1kdAbOHqk1ayPKjg1hOM8zHFzex/DCYXUzf9kp/XwQCsCv 2GqDCbhaD/hzuwqcz0HxyYhuf4kG8c9qhQkTknKQ9Zbg9QrnuepfzSjFCj210h6c0zyv z78OmnudddcPX0LlmwRWfrxCt+8kvMrzQvKO2f0NFaO6cfquaPUsninVGQkf31omvvMa mev2mUytug8GtjLxe9BEKh9LVFvZ+/5wH3YsZHPVCr2m3Ab2NkBnm6bLfe62nb/yIwLB VxIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=eDzMtGsXQXBapViwWo6OHcz00vPxTv4m91Ufivn7QlE=; b=TkapEiGKe9LtZI6p4QkxUPbdqMGfF8hHVrrPeTL8PC+BBgHwLDHxMaKqxMGimp/bgZ mj8EeUMEep+Go211k12ljgB1pIykGqerA4iwzevDEiIUnZ9yTFjNCsq0idQQ3ou43Ux+ llmCL26w1S3mvaksAfYn43FcSgHzOpID882rp0qUnE/WhKV/+QMko2abM3VSVJU8qJ+K K4ouYpfgNEJz28i7SxOHkblVVO1jp1McymGjEsREoXQcapAFq/Wpt9/k5lnAtVzByuJG qFNTWsXz7MEhPJ9dXbSqeK91gj9CL9X5AQzOKUfGjvQOgPPtHyFOWyFXVPF1kFeT7lic i/Yg== X-Gm-Message-State: APf1xPC8AptZ9RLDi8GY6OK9prMTb684MAOheasZCfYWP9g7ekaLh24q stbp03dI+OnkFX+1lYlTKu8= X-Received: by 10.99.113.85 with SMTP id b21mr16026767pgn.305.1520354959901; Tue, 06 Mar 2018 08:49:19 -0800 (PST) Received: from dell5510 ([85.119.94.113]) by smtp.gmail.com with ESMTPSA id r80sm33105451pfe.170.2018.03.06.08.49.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Mar 2018 08:49:19 -0800 (PST) Date: Tue, 6 Mar 2018 17:49:10 +0100 From: Petr Vorel To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Sam Ravnborg , Michal Marek , Ulf Magnusson , Eugeniu Rosca , Randy Dunlap , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kconfig: make unmet dependency warnings readable Message-ID: <20180306164910.tpdhl4e5xzvmwcua@dell5510> Reply-To: Petr Vorel References: <1520333499-31854-1-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520333499-31854-1-git-send-email-yamada.masahiro@socionext.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, ... > $ make allyesconfig > scripts/kconfig/conf --allyesconfig Kconfig > warning: (A && B && D) selects E which has unmet direct > dependencies (DEP1 && DEP2) > Here, I see some points to be improved. > First, '(A || B || D)' would make more sense than '(A && B && D)'. Good point, make sense, current is really confusing. > I am not sure if this is intentional, but expr_simplify_unmet_dep() > turns OR expressions into AND, like follows: > case E_OR: > return expr_alloc_and( > Second, we see false positives. 'A' is a real unmet dependency. > 'B' is false positive because 'DEP1' is fixed to 'y', and 'B' depends > on 'DEP2'. 'C' was correctly dropped by expr_simplify_unmet_dep(). > 'D' is also false positive because it has no chance to be enabled. > Current expr_simplify_unmet_dep() cannot avoid those false positives. > After all, I decided to use the same helpers as used for printing > reverse dependencies in the help. > With this commit, unreadable warnings in the real world: > $ make ARCH=score allyesconfig > scripts/kconfig/conf --allyesconfig Kconfig > warning: (HWSPINLOCK_QCOM && AHCI_MTK && STMMAC_PLATFORM && DWMAC_IPQ806X > && DWMAC_LPC18XX && DWMAC_OXNAS && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMA > C_STI && TI_CPSW && PINCTRL_GEMINI && PINCTRL_OXNAS && PINCTRL_ROCKCHIP && > PINCTRL_DOVE && PINCTRL_ARMADA_37XX && PINCTRL_STM32 && S3C2410_WATCHDOG > && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK && RTC_DRV_AT91SAM9 && LP > C18XX_DMAMUX && VIDEO_OMAP4 && COMMON_CLK_GEMINI && COMMON_CLK_ASPEED && C > OMMON_CLK_NXP && COMMON_CLK_OXNAS && COMMON_CLK_BOSTON && ATMEL_ST && QCOM > _ADSP_PIL && QCOM_Q6V5_PIL && QCOM_GSBI && ATMEL_EBI && ST_IRQCHIP && RESE > T_IMX7 && PHY_HI6220_USB && PHY_RALINK_USB && PHY_ROCKCHIP_PCIE && PHY_DA8 > XX_USB) selects MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM) > warning: (PINCTRL_AT91 && PINCTRL_AT91PIO4 && PINCTRL_OXNAS && PINCTRL_PIS > TACHIO && PINCTRL_PIC32 && PINCTRL_MESON && PINCTRL_NOMADIK && PINCTRL_MTK > && PINCTRL_MT7622 && GPIO_TB10X) selects OF_GPIO which has unmet direct d > ependencies (GPIOLIB && OF && HAS_IOMEM) > warning: (FAULT_INJECTION_STACKTRACE_FILTER && LATENCYTOP && LOCKDEP) sele > cts FRAME_POINTER which has unmet direct dependencies (DEBUG_KERNEL && (CR > IS || M68K || FRV || UML || SUPERH || BLACKFIN || MN10300 || METAG) || ARC > H_WANT_FRAME_POINTERS) > will be turned into: > $ make ARCH=score allyesconfig > scripts/kconfig/conf --allyesconfig Kconfig > WARNING: > Unmet direct dependencies detected for MFD_SYSCON > Depends on: > HAS_IOMEM [=n] > Selected by [y]: > - PINCTRL_STM32 [=y] && PINCTRL [=y] && (ARCH_STM32 || COMPILE_TEST [=y]) > && OF [=y] > - RTC_DRV_AT91SAM9 [=y] && RTC_CLASS [=y] && (ARCH_AT91 || COMPILE_TEST > [=y]) > - ATMEL_ST [=y] && GENERIC_CLOCKEVENTS [=y] > - RESET_IMX7 [=y] && RESET_CONTROLLER [=y] > - PHY_HI6220_USB [=y] && (ARCH_HISI && ARM64 || COMPILE_TEST [=y]) > - PHY_RALINK_USB [=y] && (RALINK || COMPILE_TEST [=y]) > - PHY_ROCKCHIP_PCIE [=y] && (ARCH_ROCKCHIP && OF [=y] || COMPILE_TEST > [=y]) > WARNING: > Unmet direct dependencies detected for OF_GPIO > Depends on: > GPIOLIB [=y] && OF [=y] && HAS_IOMEM [=n] > Selected by [y]: > - PINCTRL_MTK [=y] && PINCTRL [=y] && (ARCH_MEDIATEK || COMPILE_TEST > [=y]) && OF [=y] > - PINCTRL_MT7622 [=y] && PINCTRL [=y] && (ARCH_MEDIATEK || COMPILE_TEST > [=y]) && OF [=y] && (ARM64 || COMPILE_TEST [=y]) > WARNING: > Unmet direct dependencies detected for FRAME_POINTER > Depends on: > DEBUG_KERNEL [=y] && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN > || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS [=n] > Selected by [y]: > - LATENCYTOP [=y] && DEBUG_KERNEL [=y] && STACKTRACE_SUPPORT [=y] && > PROC_FS [=y] && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && > !ARC && !X86 Although I liked the brevity of current form (one liner is nice), fixing false positives justify it enough. The same look and feel with help and reusing code makes are also pros. > Signed-off-by: Masahiro Yamada Reviewed-by: Petr Vorel ... > +static void sym_warn_unmet_dependency(struct symbol *sym) > +{ > + struct gstr gs = str_new(); > + > + str_printf(&gs, "\nWARNING:\n"); > + str_printf(&gs, " Unmet direct dependencies detected for %s\n", Just one change: keep error on the same line as 'WARNING:': str_printf(&gs, "\nWARNING: Unmet direct dependencies detected for %s\n", It's make easier to grep error and save space vertically. Kind regards, Petr