From patchwork Tue Sep 30 18:09:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Bolle X-Patchwork-Id: 5006341 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73CDD9F327 for ; Tue, 30 Sep 2014 18:09:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D24E200F2 for ; Tue, 30 Sep 2014 18:09:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADD432015D for ; Tue, 30 Sep 2014 18:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbaI3SJX (ORCPT ); Tue, 30 Sep 2014 14:09:23 -0400 Received: from cpsmtpb-ews03.kpnxchange.com ([213.75.39.6]:52218 "EHLO cpsmtpb-ews03.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbaI3SJW (ORCPT ); Tue, 30 Sep 2014 14:09:22 -0400 Received: from cpsps-ews12.kpnxchange.com ([10.94.84.179]) by cpsmtpb-ews03.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Tue, 30 Sep 2014 20:09:19 +0200 Received: from CPSMTPM-TLF103.kpnxchange.com ([195.121.3.6]) by cpsps-ews12.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Tue, 30 Sep 2014 20:09:19 +0200 Received: from [192.168.10.104] ([77.173.140.92]) by CPSMTPM-TLF103.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Tue, 30 Sep 2014 20:09:19 +0200 Message-ID: <1412100559.21730.30.camel@x220> Subject: [PATCH 0/1] kconfig: warn if an unknown symbol is selected From: Paul Bolle To: "Yann E. MORIN" Cc: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 30 Sep 2014 20:09:19 +0200 X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 X-OriginalArrivalTime: 30 Sep 2014 18:09:19.0172 (UTC) FILETIME=[A768F040:01CFDCD9] X-RcptDomain: vger.kernel.org Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is an attempt to make a recurring kconfig issue more visible: select statements for unknown, or unreachable, Kconfig symbols. See, I've submitted quite a few patches that remove statements like select BOGUS One of the annoying properties of kconfig is that select statements like that are silently treated as a nop. That makes them surprisingly easy to stay unnoticed. Some of them are caught by my local "800 line perl monster", but not all. But perhaps silently skipping these statements is actually considered a feature. I think it is not. Anyhow, I've tweaked kconfig to warn about them. Then I ran kconfig on all (500+) in tree defconfig files as of next-20140930. These are the select statements it warns about when doing that. The most interesting are 8 (CPU_IDLE), 10 (PREEMPT_COUNT) and 11 (ZONE_DMA). 1) arch/arm/Kconfig:429:warning: 'ARCH_EFM32' selects unknown symbol 'NO_DMA' Unknown on arm. Patch submitted. 2) arch/arm/mach-meson/Kconfig:11:warning: 'MACH_MESON6' selects unknown symbol 'MESON6_TIMER' Clearly bogus select. But Kconfig symbol MESON6_TIMER is apparently queued. 3) arch/arm/mach-mvebu/Kconfig:40:warning: 'MACH_ARMADA_375' selects unknown symbol 'ARM_ERRATA_753970' arch/arm/mach-mvebu/Kconfig:55:warning: 'MACH_ARMADA_38X' selects unknown symbol 'ARM_ERRATA_753970' Typo. Patch is being discussed for some time now. 4) arch/arm/mach-shmobile/Kconfig:39:warning: 'ARCH_SHMOBILE_MULTI' selects unknown symbol 'ARCH_HAS_OPP' Unfinished Kconfig cleanup. Patches submitted and/or queued. 5) arch/hexagon/Kconfig:22:warning: 'HEXAGON' selects unknown symbol 'NO_IOPORT_MAP' Unknown on hexagon. Patch submitted and already Acked. 6) arch/powerpc/platforms/44x/Kconfig:217:warning: 'AKEBONO' selects unknown symbol 'IBM_EMAC_RGMII_WOL' arch/powerpc/platforms/44x/Kconfig:223:warning: 'AKEBONO' selects unknown symbol 'MMC_SDHCI_OF_476GTR' Clearly bogus selects. One symbol might be queued. Not sure why the other select hasn't been removed. 7) arch/score/Kconfig:24:warning: 'ARCH_SCORE7' selects unknown symbol 'SYS_SUPPORTS_32BIT_KERNEL' arch/score/Kconfig:28:warning: 'MACH_SPCT6600' selects unknown symbol 'SYS_SUPPORTS_32BIT_KERNEL' arch/score/Kconfig:32:warning: 'SCORE_SIM' selects unknown symbol 'SYS_SUPPORTS_32BIT_KERNEL' Bogus. Submitted a patch long ago. Nothing happened. 8) drivers/acpi/Kconfig:165:warning: 'ACPI_PROCESSOR' selects unknown symbol 'CPU_IDLE' Unreachable for eg ia64. Perhaps fixed by: Not sure, however. 11) sound/pci/Kconfig:158:warning: 'SND_AZT3328' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:28:warning: 'SND_ALS300' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:466:warning: 'SND_EMU10K1' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:482:warning: 'SND_EMU10K1X' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:516:warning: 'SND_ES1938' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:528:warning: 'SND_ES1968' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:53:warning: 'SND_ALI5451' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:615:warning: 'SND_ICE1712' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:703:warning: 'SND_MAESTRO3' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:812:warning: 'SND_SONICVIBES' selects unknown symbol 'ZONE_DMA' sound/pci/Kconfig:824:warning: 'SND_TRIDENT' selects unknown symbol 'ZONE_DMA' Seen on parisc and sh. Tricky. See commit 80ab8eae70e5 ("ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks"). Nice quote from Andrew Morton about adding these selects (instead of fixing the underlying problem): But then we'll just forget about it :( (https://bugzilla.kernel.org/show_bug.cgi?id=68221#c19 ). Comments welcome! Paul Bolle (1): kconfig: warn if an unknown symbol is selected scripts/kconfig/conf.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -162,7 +162,7 @@ config ACPI_DOCK config ACPI_PROCESSOR tristate "Processor" select THERMAL - select CPU_IDLE + select CPU_IDLE if (ARM || ARM64 || MIPS || PPC || X86 || SUPERH) default y help This driver installs ACPI as the idle handler for Linux and uses 9) drivers/irqchip/Kconfig:16:warning: 'ARM_GIC_V3' selects unknown symbol 'MULTI_IRQ_HANDLER' drivers/irqchip/Kconfig:8:warning: 'ARM_GIC' selects unknown symbol 'MULTI_IRQ_HANDLER' MULTI_IRQ_HANDLER is arm specific. So arm64 builds trigger this. Suggested fix: --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -5,7 +5,7 @@ config IRQCHIP config ARM_GIC bool select IRQ_DOMAIN - select MULTI_IRQ_HANDLER + select MULTI_IRQ_HANDLER if ARM config GIC_NON_BANKED bool @@ -13,7 +13,6 @@ config GIC_NON_BANKED config ARM_GIC_V3 bool select IRQ_DOMAIN - select MULTI_IRQ_HANDLER config ARM_NVIC bool 10) lib/Kconfig.debug:1008:warning: 'DEBUG_ATOMIC_SLEEP' selects unknown symbol 'PREEMPT_COUNT' Not all architectures have PREEMPT_COUNT. Maybe fixed by: --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1005,7 +1005,7 @@ config DEBUG_LOCKDEP config DEBUG_ATOMIC_SLEEP bool "Sleep inside atomic section checking" - select PREEMPT_COUNT + select PREEMPT_COUNT if !(ALPHA || FRV || HEXAGON || UML) depends on DEBUG_KERNEL help If you say Y here, various routines which may sleep will become very