From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. Date: Tue, 28 May 2013 19:20:37 +0200 Message-ID: <201305281920.37452.arnd@arndb.de> References: <519DCBEF.3090208@asianux.com> <201305281743.52649.arnd@arndb.de> <51A4D618.3080208@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51A4D618.3080208-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: uclinux-dist-devel-bounces-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org Errors-To: uclinux-dist-devel-bounces-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org To: "H. Peter Anvin" Cc: Linux-sh list , Catalin Marinas , Benjamin Herrenschmidt , Chen Gang , Heiko Carstens , "paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org" , Michel Lespinasse , Ingo Molnar , Hans-Christian Egtvedt , Linux-Arch , linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Russell King - ARM Linux , Yoshinori Sato , Richard Weinberger , Helge Deller , the arch/x86 maintainers , "James E.J. Bottomley" , "mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Geert Uytterhoeven List-Id: linux-arch.vger.kernel.org On Tuesday 28 May 2013, H. Peter Anvin wrote: > On 05/28/2013 08:43 AM, Arnd Bergmann wrote: > > > > Right, that is what the patch I just posted does. > > > > On a related note, I found that WARN_ON() can no longer be compiled > > out since there is already code that relies on the side-effects of > > the condition. I assume that was an intentional change I missed, > > since it used to be defined so that you could remove it completely. > > > > It is possible to define WARN_ON() as: > > #define WARN_ON(x) ((void)(x)) > > ... which preserves side effects. Yes, actually the return value has to be maintained as well. The current (!CONFIG_BUG) default implementation is #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ unlikely(__ret_warn_on); \ }) which seems fine. #define WARN_ON(condition) unlikely(!!(condition)) is probably just as good. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. Date: Tue, 28 May 2013 19:20:37 +0200 Message-ID: <201305281920.37452.arnd@arndb.de> References: <519DCBEF.3090208@asianux.com> <201305281743.52649.arnd@arndb.de> <51A4D618.3080208@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Linux-sh list , Catalin Marinas , Benjamin Herrenschmidt , Chen Gang , Heiko Carstens , "paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org" , Michel Lespinasse , Ingo Molnar , Hans-Christian Egtvedt , Linux-Arch , linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Russell King - ARM Linux , Yoshinori Sato , Richard Weinberger , Helge Deller , the arch/x86 maintainers , "James E.J. Bottomley" , "mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Geert Uytterhoeven , To: "H. Peter Anvin" Return-path: In-Reply-To: <51A4D618.3080208-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclinux-dist-devel-bounces-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org On Tuesday 28 May 2013, H. Peter Anvin wrote: > On 05/28/2013 08:43 AM, Arnd Bergmann wrote: > > > > Right, that is what the patch I just posted does. > > > > On a related note, I found that WARN_ON() can no longer be compiled > > out since there is already code that relies on the side-effects of > > the condition. I assume that was an intentional change I missed, > > since it used to be defined so that you could remove it completely. > > > > It is possible to define WARN_ON() as: > > #define WARN_ON(x) ((void)(x)) > > ... which preserves side effects. Yes, actually the return value has to be maintained as well. The current (!CONFIG_BUG) default implementation is #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ unlikely(__ret_warn_on); \ }) which seems fine. #define WARN_ON(condition) unlikely(!!(condition)) is probably just as good. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Arnd Bergmann Date: Tue, 28 May 2013 19:20:37 +0200 References: <519DCBEF.3090208@asianux.com> <201305281743.52649.arnd@arndb.de> <51A4D618.3080208@zytor.com> In-Reply-To: <51A4D618.3080208@zytor.com> MIME-Version: 1.0 Message-Id: <201305281920.37452.arnd@arndb.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linuxppc-dev-bounces+geert=linux-m68k.org@lists.ozlabs.org Sender: "Linuxppc-dev" Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. To: "H. Peter Anvin" Cc: Catalin Marinas , Linux-sh list , Chen Gang , Heiko Carstens , "paulus@samba.org" , Michel Lespinasse , Ingo Molnar , 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" , Geert Uytterhoeven , Frederic Weisbecker , Paul McKenney , H?vard 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 , Linus Torvalds , "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 List-ID: On Tuesday 28 May 2013, H. Peter Anvin wrote: > On 05/28/2013 08:43 AM, Arnd Bergmann wrote: > > > > Right, that is what the patch I just posted does. > > > > On a related note, I found that WARN_ON() can no longer be compiled > > out since there is already code that relies on the side-effects of > > the condition. I assume that was an intentional change I missed, > > since it used to be defined so that you could remove it completely. > > > > It is possible to define WARN_ON() as: > > #define WARN_ON(x) ((void)(x)) > > ... which preserves side effects. Yes, actually the return value has to be maintained as well. The current (!CONFIG_BUG) default implementation is #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ unlikely(__ret_warn_on); \ }) which seems fine. #define WARN_ON(condition) unlikely(!!(condition)) is probably just as good. Arnd _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 10CFE2C02ED for ; Wed, 29 May 2013 03:23:35 +1000 (EST) From: Arnd Bergmann To: "H. Peter Anvin" Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. Date: Tue, 28 May 2013 19:20:37 +0200 References: <519DCBEF.3090208@asianux.com> <201305281743.52649.arnd@arndb.de> <51A4D618.3080208@zytor.com> In-Reply-To: <51A4D618.3080208@zytor.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Message-Id: <201305281920.37452.arnd@arndb.de> Cc: Catalin Marinas , Linux-sh list , Chen Gang , Heiko Carstens , "paulus@samba.org" , Michel Lespinasse , Ingo Molnar , 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" , Geert Uytterhoeven , Frederic Weisbecker , Paul McKenney , H?vard 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 , Linus Torvalds , "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 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tuesday 28 May 2013, H. Peter Anvin wrote: > On 05/28/2013 08:43 AM, Arnd Bergmann wrote: > > > > Right, that is what the patch I just posted does. > > > > On a related note, I found that WARN_ON() can no longer be compiled > > out since there is already code that relies on the side-effects of > > the condition. I assume that was an intentional change I missed, > > since it used to be defined so that you could remove it completely. > > > > It is possible to define WARN_ON() as: > > #define WARN_ON(x) ((void)(x)) > > ... which preserves side effects. Yes, actually the return value has to be maintained as well. The current (!CONFIG_BUG) default implementation is #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ unlikely(__ret_warn_on); \ }) which seems fine. #define WARN_ON(condition) unlikely(!!(condition)) is probably just as good. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Tue, 28 May 2013 19:20:37 +0200 Subject: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. In-Reply-To: <51A4D618.3080208@zytor.com> References: <519DCBEF.3090208@asianux.com> <201305281743.52649.arnd@arndb.de> <51A4D618.3080208@zytor.com> Message-ID: <201305281920.37452.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tuesday 28 May 2013, H. Peter Anvin wrote: > On 05/28/2013 08:43 AM, Arnd Bergmann wrote: > > > > Right, that is what the patch I just posted does. > > > > On a related note, I found that WARN_ON() can no longer be compiled > > out since there is already code that relies on the side-effects of > > the condition. I assume that was an intentional change I missed, > > since it used to be defined so that you could remove it completely. > > > > It is possible to define WARN_ON() as: > > #define WARN_ON(x) ((void)(x)) > > ... which preserves side effects. Yes, actually the return value has to be maintained as well. The current (!CONFIG_BUG) default implementation is #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ unlikely(__ret_warn_on); \ }) which seems fine. #define WARN_ON(condition) unlikely(!!(condition)) is probably just as good. Arnd