Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, Oct 18, 2007 at 03:17:52PM -0700, Andrew Morton wrote: > On Thu, 11 Oct 2007 12:12:11 -0500 > Olof Johansson <[EMAIL PROTECTED]> wrote: > > > HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() > > macro, or if a generic one is needed. > > > > With this, some of the arch-specific WARN_ON() implementations can be > > made common instead (see follow-up patch for powerpc). > > > > Those HAVE_ARCH_foo things are unpleasant. [...] > Can't we just do #ifndef __WARN? Yep, good idea. I'll respin. -Olof - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, 11 Oct 2007 12:12:11 -0500 Olof Johansson <[EMAIL PROTECTED]> wrote: > HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() > macro, or if a generic one is needed. > > With this, some of the arch-specific WARN_ON() implementations can be > made common instead (see follow-up patch for powerpc). > Those HAVE_ARCH_foo things are unpleasant. > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > index d56fedb..c6b8386 100644 > --- a/include/asm-generic/bug.h > +++ b/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 > +#define __WARN() do { > \ > + printk("WARNING: at %s:%d %s()\n", __FILE__,\ > + __LINE__, __FUNCTION__);\ > + dump_stack(); \ > +} while (0) > +#endif Can't we just do #ifndef __WARN? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, 11 Oct 2007 12:12:11 -0500 Olof Johansson [EMAIL PROTECTED] wrote: HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() macro, or if a generic one is needed. With this, some of the arch-specific WARN_ON() implementations can be made common instead (see follow-up patch for powerpc). Those HAVE_ARCH_foo things are unpleasant. diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index d56fedb..c6b8386 100644 --- a/include/asm-generic/bug.h +++ b/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 +#define __WARN() do { \ + printk(WARNING: at %s:%d %s()\n, __FILE__,\ + __LINE__, __FUNCTION__);\ + dump_stack(); \ +} while (0) +#endif Can't we just do #ifndef __WARN? - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, Oct 18, 2007 at 03:17:52PM -0700, Andrew Morton wrote: On Thu, 11 Oct 2007 12:12:11 -0500 Olof Johansson [EMAIL PROTECTED] wrote: HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() macro, or if a generic one is needed. With this, some of the arch-specific WARN_ON() implementations can be made common instead (see follow-up patch for powerpc). Those HAVE_ARCH_foo things are unpleasant. [...] Can't we just do #ifndef __WARN? Yep, good idea. I'll respin. -Olof - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, Oct 11, 2007 at 12:12:11PM -0500, Olof Johansson wrote: > HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() > macro, or if a generic one is needed. > > With this, some of the arch-specific WARN_ON() implementations can be > made common instead (see follow-up patch for powerpc). > > Signed-off-by: Olof Johansson <[EMAIL PROTECTED]> > sh bits are fine. Acked-by: Paul Mundt <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, Oct 11, 2007 at 12:12:11PM -0500, Olof Johansson wrote: > HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() > macro, or if a generic one is needed. > > With this, some of the arch-specific WARN_ON() implementations can be > made common instead (see follow-up patch for powerpc). > > Signed-off-by: Olof Johansson <[EMAIL PROTECTED]> > ack parisc hunk (obviously :) cheers, kyle - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() macro, or if a generic one is needed. With this, some of the arch-specific WARN_ON() implementations can be made common instead (see follow-up patch for powerpc). Signed-off-by: Olof Johansson <[EMAIL PROTECTED]> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index d56fedb..c6b8386 100644 --- a/include/asm-generic/bug.h +++ b/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 +#define __WARN() do { \ + printk("WARNING: at %s:%d %s()\n", __FILE__,\ + __LINE__, __FUNCTION__);\ + dump_stack(); \ +} while (0) +#endif + #ifndef HAVE_ARCH_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 diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h index 8cfc553..3f68100 100644 --- a/include/asm-parisc/bug.h +++ b/include/asm-parisc/bug.h @@ -8,6 +8,7 @@ #ifdef CONFIG_BUG #define HAVE_ARCH_BUG +#define HAVE_ARCH_WARN #define HAVE_ARCH_WARN_ON /* the break instruction is used as BUG() marker. */ diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h index e55d1f6..02e171c 100644 --- a/include/asm-powerpc/bug.h +++ b/include/asm-powerpc/bug.h @@ -110,6 +110,7 @@ }) #define HAVE_ARCH_BUG +#define HAVE_ARCH_WARN #define HAVE_ARCH_BUG_ON #define HAVE_ARCH_WARN_ON #endif /* __ASSEMBLY __ */ diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h index a78d482..4ea415b 100644 --- a/include/asm-sh/bug.h +++ b/include/asm-sh/bug.h @@ -5,6 +5,7 @@ #ifdef CONFIG_BUG #define HAVE_ARCH_BUG +#define HAVE_ARCH_WARN #define HAVE_ARCH_WARN_ON /** - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() macro, or if a generic one is needed. With this, some of the arch-specific WARN_ON() implementations can be made common instead (see follow-up patch for powerpc). Signed-off-by: Olof Johansson [EMAIL PROTECTED] diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index d56fedb..c6b8386 100644 --- a/include/asm-generic/bug.h +++ b/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 +#define __WARN() do { \ + printk(WARNING: at %s:%d %s()\n, __FILE__,\ + __LINE__, __FUNCTION__);\ + dump_stack(); \ +} while (0) +#endif + #ifndef HAVE_ARCH_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 diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h index 8cfc553..3f68100 100644 --- a/include/asm-parisc/bug.h +++ b/include/asm-parisc/bug.h @@ -8,6 +8,7 @@ #ifdef CONFIG_BUG #define HAVE_ARCH_BUG +#define HAVE_ARCH_WARN #define HAVE_ARCH_WARN_ON /* the break instruction is used as BUG() marker. */ diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h index e55d1f6..02e171c 100644 --- a/include/asm-powerpc/bug.h +++ b/include/asm-powerpc/bug.h @@ -110,6 +110,7 @@ }) #define HAVE_ARCH_BUG +#define HAVE_ARCH_WARN #define HAVE_ARCH_BUG_ON #define HAVE_ARCH_WARN_ON #endif /* __ASSEMBLY __ */ diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h index a78d482..4ea415b 100644 --- a/include/asm-sh/bug.h +++ b/include/asm-sh/bug.h @@ -5,6 +5,7 @@ #ifdef CONFIG_BUG #define HAVE_ARCH_BUG +#define HAVE_ARCH_WARN #define HAVE_ARCH_WARN_ON /** - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, Oct 11, 2007 at 12:12:11PM -0500, Olof Johansson wrote: HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() macro, or if a generic one is needed. With this, some of the arch-specific WARN_ON() implementations can be made common instead (see follow-up patch for powerpc). Signed-off-by: Olof Johansson [EMAIL PROTECTED] ack parisc hunk (obviously :) cheers, kyle - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN
On Thu, Oct 11, 2007 at 12:12:11PM -0500, Olof Johansson wrote: HAVE_ARCH_WARN is used to determine if an arch already has a __WARN() macro, or if a generic one is needed. With this, some of the arch-specific WARN_ON() implementations can be made common instead (see follow-up patch for powerpc). Signed-off-by: Olof Johansson [EMAIL PROTECTED] sh bits are fine. Acked-by: Paul Mundt [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/