From patchwork Thu May 23 09:39:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2605891 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 4144FDFB78 for ; Thu, 23 May 2013 09:42:05 +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 1UfS1s-0002zF-Ck; Thu, 23 May 2013 09:41:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfS1a-0006a1-S2; Thu, 23 May 2013 09:41:30 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfS1W-0006ZV-8U for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2013 09:41:29 +0000 Received: from klappe2.localnet (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0Lzrl5-1USIap3qHT-0154WL; Thu, 23 May 2013 11:39:46 +0200 From: Arnd Bergmann To: Geert Uytterhoeven Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. Date: Thu, 23 May 2013 11:39:37 +0200 User-Agent: KMail/1.12.2 (Linux/3.8.0-22-generic; KDE/4.3.2; x86_64; ; ) References: <519DCBEF.3090208@asianux.com> <20130523090534.GJ18614@n2100.arm.linux.org.uk> In-Reply-To: MIME-Version: 1.0 Message-Id: <201305231139.38233.arnd@arndb.de> X-Provags-ID: V02:K0:ho9TYrm8u8JbtqwnBV26oS5MTtijS7CUKl1bPqdn2F3 qZ335NlSdvMbcNS27UutQ9K+wBw4JBRNy6YfpkKz2UOfLHl74Q zpgd//bGUu6SvJC//fWI+ABbx4c2ilNPy7E91xAk12mGC55RE6 Yy8n4V8TlWdp31+4Zdz+o+gPd2wsdCN2scI1BtNBNUTUQT63d8 qmB2DwOtvqObGV+5GPlIvQVpfT8GTmTsStPyjOUFS+PVVkHAby /i4owYhYKDA+/Cvh+WqSkP+veoLT1qQe2ZR8FhYWDJKhaGrRaT A4quClW/AZqYGK+Wt9o0DT/IB09qZRYgo2vOLybCgQwByhDTT3 D9guKv811QCWLsxWBkRc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130523_054126_507796_BA394B58 X-CRM114-Status: GOOD ( 20.40 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Catalin Marinas , Linux-sh list , Benjamin Herrenschmidt , Chen Gang , Heiko Carstens , "paulus@samba.org" , "H. Peter Anvin" , Michel Lespinasse , Hans-Christian Egtvedt , Linux-Arch , linux-s390@vger.kernel.org, Russell King - ARM Linux , Yoshinori Sato , Richard Weinberger , Helge Deller , the arch/x86 maintainers , "James E.J. Bottomley" , "mingo@redhat.com" , Frederic Weisbecker , Paul McKenney , =?utf-8?q?H=C3=A5vard_Skinnemoen?= , Serge Hallyn , Mike Frysinger , uml-devel , Will Deacon , Jeff Dike , Akinobu Mita , uml-user , "uclinux-dist-devel@blackfin.uclinux.org" , Thomas Gleixner , "linux-arm-kernel@lists.infradead.org" , Parisc List , "linux-kernel@vger.kernel.org" , Richard Kuo , Paul Mundt , "Eric W. Biederman" , linux-hexagon@vger.kernel.org, Martin Schwidefsky , linux390@de.ibm.com, Andrew Morton , "linuxppc-dev@lists.ozlabs.org" , David Miller 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 On Thursday 23 May 2013, Geert Uytterhoeven wrote: > > The problem is: trying to fix that will mean the result is a larger > > kernel than if you just do the usual arch-implemented thing of placing > > an defined faulting instruction at the BUG() site - which defeats the > > purpose of turning off CONFIG_BUG. > > Is __builtin_unreachable() working well these days? > Hmm, I just tried the trivial patch below, which seemed to do the right thing. Needs a little more investigation, but that might actually be the correct solution. I thought that at some point __builtin_unreachable() was the same as "do {} while (1)", but this is not the case with the gcc I was using -- it just tells gcc that we don't expect to ever get here. Signed-off-by: Arnd Bergmann diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 7d10f96..9afff7d 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -108,11 +108,11 @@ extern void warn_slowpath_null(const char *file, const int line); #else /* !CONFIG_BUG */ #ifndef HAVE_ARCH_BUG -#define BUG() do {} while(0) +#define BUG() __builtin_unreachable () #endif #ifndef HAVE_ARCH_BUG_ON -#define BUG_ON(condition) do { if (condition) ; } while(0) +#define BUG_ON(condition) do { if (condition) __builtin_unreachable(); } while(0) #endif #ifndef HAVE_ARCH_WARN_ON