From patchwork Thu May 23 07:57:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 2605101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 8F6C6DFB78 for ; Thu, 23 May 2013 07:59:04 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfQQQ-0005NZ-U1; Thu, 23 May 2013 07:59:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfQQO-0003lx-Go; Thu, 23 May 2013 07:59:00 +0000 Received: from intranet.asianux.com ([58.214.24.6]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfQQJ-0003l8-Uy for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2013 07:58:59 +0000 Received: by intranet.asianux.com (Postfix, from userid 103) id 4A63B184041B; Thu, 23 May 2013 15:58:27 +0800 (CST) X-Spam-Score: -100.8 X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on intranet.asianux.com X-Spam-Level: X-Spam-Status: No, score=-100.8 required=5.0 tests=AWL,BAYES_00, RATWARE_GECKO_BUILD,USER_IN_WHITELIST autolearn=no version=3.1.9 Received: from [10.1.0.143] (unknown [219.143.36.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id 726811840251; Thu, 23 May 2013 15:58:25 +0800 (CST) Message-ID: <519DCBEF.3090208@asianux.com> Date: Thu, 23 May 2013 15:57:35 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Russell King - ARM Linux , hskinnemoen@gmail.com, egtvedt@samfundet.no, Mike Frysinger , ysato@users.sourceforge.jp, rkuo@codeaurora.org, jejb@parisc-linux.org, deller@gmx.de, Benjamin Herrenschmidt , "paulus@samba.org" , schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, linux390@de.ibm.com, lethal@linux-sh.org, jdike@addtoit.com, richard@nod.at, Thomas Gleixner , "mingo@redhat.com" , hpa@zytor.com, x86@kernel.org, Arnd Bergmann , "Eric W. Biederman" , Serge Hallyn , paulmck@linux.vnet.ibm.com, Frederic Weisbecker , David Miller , Andrew Morton , akinobu.mita@gmail.com, Catalin Marinas , walken@google.com, Will Deacon , Geert Uytterhoeven Subject: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130523_035856_759946_9D7D7E1C X-CRM114-Status: GOOD ( 20.48 ) X-Spam-Score: -3.0 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, "linux-kernel@vger.kernel.org" , user-mode-linux-user@lists.sourceforge.net, uclinux-dist-devel@blackfin.uclinux.org, "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The crazy user can unset 'CONFIG_BUG' in menuconfig: "> General setup > Configure standard kernel features (expert users) > BUG() Support". But in fact, we always need it, and quite a few of architectures have already implemented it (e.g. alpha, arc, arm, avr32, blackfin, cris, frv, ia64, m68k, mips, mn10300, parisc, powerpc, s390, sh, sparc, x86). And kernel also already has prepared a default effective implementation for the architectures which is unwilling to implement it by themselves (e.g. arm64, c6x, h8300, hexagon, m32r, metag, microblaze, openrisc, score, tile, um, unicore32, xtensa). So need get rid of 'CONFIG_BUG', and let it always enabled everywhere. Signed-off-by: Chen Gang Acked-by: "Eric W. Biederman" --- arch/arm/Kconfig | 1 - arch/avr32/Kconfig | 1 - arch/blackfin/Kconfig | 1 - arch/h8300/Kconfig | 1 - arch/hexagon/Kconfig | 1 - arch/parisc/Kconfig | 2 -- arch/powerpc/Kconfig | 1 - arch/s390/Kconfig | 2 +- arch/sh/Kconfig | 2 +- arch/um/Kconfig.common | 1 - arch/x86/Kconfig | 1 - include/asm-generic/bug.h | 29 ----------------------------- init/Kconfig | 10 ---------- lib/Kconfig.debug | 2 +- 14 files changed, 3 insertions(+), 52 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a7fc5ea..ea4a146 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -265,7 +265,6 @@ config PHYS_OFFSET config GENERIC_BUG def_bool y - depends on BUG source "init/Kconfig" diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index bdc3558..7c9005a 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -55,7 +55,6 @@ config GENERIC_CALIBRATE_DELAY config GENERIC_BUG def_bool y - depends on BUG source "init/Kconfig" diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index a117652..637dc42 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -47,7 +47,6 @@ config GENERIC_CSUM config GENERIC_BUG def_bool y - depends on BUG config ZONE_DMA def_bool y diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 303e4f9..88848da 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -56,7 +56,6 @@ config GENERIC_CALIBRATE_DELAY config GENERIC_BUG bool - depends on BUG config TIME_LOW_RES bool diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 33a9792..f50cc8f 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -84,7 +84,6 @@ config STACKTRACE_SUPPORT config GENERIC_BUG def_bool y - depends on BUG menu "Machine selection" diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 6507dab..5de1f8c 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -10,7 +10,6 @@ config PARISC select RTC_CLASS select RTC_DRV_GENERIC select INIT_ALL_POSSIBLE - select BUG select HAVE_PERF_EVENTS select GENERIC_ATOMIC64 if !64BIT select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE @@ -62,7 +61,6 @@ config ARCH_HAS_ILOG2_U64 config GENERIC_BUG bool default y - depends on BUG config GENERIC_HWEIGHT bool diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c33e3ad..34f4ca9 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -187,7 +187,6 @@ config AUDIT_ARCH config GENERIC_BUG bool default y - depends on BUG config SYS_SUPPORTS_APM_EMULATION default y if PMAC_APM_EMU diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index da183c5..5d7b3db 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -29,7 +29,7 @@ config GENERIC_HWEIGHT def_bool y config GENERIC_BUG - def_bool y if BUG + def_bool y config GENERIC_BUG_RELATIVE_POINTERS def_bool y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 8c868cf..d555e7f 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,7 +84,7 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_BUG def_bool y - depends on BUG && SUPERH32 + depends on SUPERH32 config GENERIC_CSUM def_bool y diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common index bceee66..7aae42a 100644 --- a/arch/um/Kconfig.common +++ b/arch/um/Kconfig.common @@ -53,7 +53,6 @@ config GENERIC_CALIBRATE_DELAY config GENERIC_BUG bool default y - depends on BUG config HZ int diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 723e42e..a36e1b4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -166,7 +166,6 @@ config GENERIC_ISA_DMA config GENERIC_BUG def_bool y - depends on BUG select GENERIC_BUG_RELATIVE_POINTERS if X86_64 config GENERIC_BUG_RELATIVE_POINTERS diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 7d10f96..5d50903 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -12,8 +12,6 @@ #ifndef __ASSEMBLY__ #include -#ifdef CONFIG_BUG - #ifdef CONFIG_GENERIC_BUG struct bug_entry { #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS @@ -106,33 +104,6 @@ extern void warn_slowpath_null(const char *file, const int line); unlikely(__ret_warn_on); \ }) -#else /* !CONFIG_BUG */ -#ifndef HAVE_ARCH_BUG -#define BUG() do {} while(0) -#endif - -#ifndef HAVE_ARCH_BUG_ON -#define BUG_ON(condition) do { if (condition) ; } while(0) -#endif - -#ifndef HAVE_ARCH_WARN_ON -#define WARN_ON(condition) ({ \ - int __ret_warn_on = !!(condition); \ - unlikely(__ret_warn_on); \ -}) -#endif - -#ifndef WARN -#define WARN(condition, format...) ({ \ - int __ret_warn_on = !!(condition); \ - unlikely(__ret_warn_on); \ -}) -#endif - -#define WARN_TAINT(condition, taint, format...) WARN_ON(condition) - -#endif - #define WARN_ON_ONCE(condition) ({ \ static bool __section(.data.unlikely) __warned; \ int __ret_warn_once = !!(condition); \ diff --git a/init/Kconfig b/init/Kconfig index 7fb26a6..bc1dd49 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1360,16 +1360,6 @@ config PRINTK very difficult to diagnose system problems, saying N here is strongly discouraged. -config BUG - bool "BUG() support" if EXPERT - default y - help - Disabling this option eliminates support for BUG and WARN, reducing - the size of your kernel image and potentially quietly ignoring - numerous fatal conditions. You should only consider disabling this - option for embedded systems with no facilities for reporting errors. - Just say Y. - config ELF_CORE depends on COREDUMP default y diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 566cf2b..54b3251 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -700,7 +700,7 @@ config HAVE_DEBUG_BUGVERBOSE config DEBUG_BUGVERBOSE bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT - depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE) + depends on GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE default y help Say Y here to make BUG() panics output the file name and line number