Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754821AbYAFDN5 (ORCPT ); Sat, 5 Jan 2008 22:13:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752434AbYAFDNs (ORCPT ); Sat, 5 Jan 2008 22:13:48 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:57759 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753405AbYAFDNr (ORCPT ); Sat, 5 Jan 2008 22:13:47 -0500 Date: Sat, 5 Jan 2008 19:08:40 -0800 From: Arjan van de Ven To: linux-kernel@vger.kernel.org Cc: Arjan van de Ven , akpm@linux-foundation.org, heiko.carstens@de.ibm.com, olof@lixom.net, mingo@elte.hu, mpm@selenic.com Subject: [patch 1/5] Introduce __WARN() Message-ID: <20080105190840.48a8c2c5@laptopd505.fenrus.org> In-Reply-To: <20080105190713.73745ec6@laptopd505.fenrus.org> References: <20080105190713.73745ec6@laptopd505.fenrus.org> Organization: Intel X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 53 From: Olof Johansson Introduce __WARN() in the generic case, so the generic WARN_ON() can use arch-specific code for when the condition is true. Signed-off-by: Olof Johansson Cc: Signed-off-by: Andrew Morton --- include/asm-generic/bug.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) Index: linux-2.6.24-rc6/include/asm-generic/bug.h =================================================================== --- linux-2.6.24-rc6.orig/include/asm-generic/bug.h +++ linux-2.6.24-rc6/include/asm-generic/bug.h @@ -31,14 +31,19 @@ struct bug_entry { #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) #endif -#ifndef HAVE_ARCH_WARN_ON +#ifndef __WARN +#define __WARN() do { \ + printk("WARNING: at %s:%d %s()\n", __FILE__, \ + __LINE__, __FUNCTION__); \ + dump_stack(); \ +} while (0) +#endif + +#ifndef WARN_ON #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) { \ - printk("WARNING: at %s:%d %s()\n", __FILE__, \ - __LINE__, __FUNCTION__); \ - dump_stack(); \ - } \ + if (unlikely(__ret_warn_on)) \ + __WARN(); \ unlikely(__ret_warn_on); \ }) #endif -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/