Skip to contentSkip to conversation

fix WARN() for PPC

PATCH In review Arjan van de Ven 4 participants 5 messages Oct 20, 2008 – Oct 23, 2008 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix WARN() for PPC

From: Arjan van de Ven <[email protected]>
Date: Mon, 20 Oct 2008 14:41:03 -0700
Subject: [PATCH] fix WARN() for PPC

powerpc doesn't use the generic WARN_ON infrastructure. The newly introduced WARN() as a result didn't print the message, this patch adds the printk for this specific case.

---
 include/asm-generic/bug.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-generic/bug.h +1 -1
index 0f6dabd..12c07c1 100644
@@ -41,7 +41,7 @@ extern void warn_slowpath(const char *file, const int line,
 #define __WARN() warn_on_slowpath(__FILE__, __LINE__)
 #define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)
 #else
-#define __WARN_printf(arg...) __WARN()
+#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)
 #endif
 
 #ifndef WARN_ON
Signature · 8 lines
1.5.5.1



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
#1 lore raw
Quoted 8 lines · Arjan van de Ven

From: Arjan van de Ven <[email protected]>
Date: Mon, 20 Oct 2008 14:41:03 -0700
Subject: [PATCH] fix WARN() for PPC

powerpc doesn't use the generic WARN_ON infrastructure. The newly introduced WARN() as a result didn't print the message, this patch adds the printk for this specific case.

Thanks, will apply.

Cheers,
Ben.

#2 lore raw
In reply to Arjan van de Ven
Quoted 5 lines · Arjan van de Ven

From: Arjan van de Ven <[email protected]>
Date: Mon, 20 Oct 2008 14:41:03 -0700
Subject: [PATCH] fix WARN() for PPC

powerpc doesn't use the generic WARN_ON infrastructure.

Hm, why's that now? The generic infrastructure was taken from powerpc, and I thought I'd converted it...

J

#3 lore raw
Quoted 10 lines · On Wed, 22 Oct 2008 13:23:21 -0700 Jeremy Fitzhardinge <[email protected]> wrote:
Quoted 5 lines · Arjan van de Ven

From: Arjan van de Ven <[email protected]>
Date: Mon, 20 Oct 2008 14:41:03 -0700
Subject: [PATCH] fix WARN() for PPC

powerpc doesn't use the generic WARN_ON infrastructure.

Hm, why's that now? The generic infrastructure was taken from powerpc, and I thought I'd converted it...

it uses a BUG like trap rather than the normal WARN_ON() being a function call to lib/bug.c

Signature · 3 lines
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
#4 lore raw
In reply to Jeremy Fitzhardinge
Quoted 9 lines · Jeremy Fitzhardinge
Quoted 5 lines · Arjan van de Ven

From: Arjan van de Ven <[email protected]>
Date: Mon, 20 Oct 2008 14:41:03 -0700
Subject: [PATCH] fix WARN() for PPC

powerpc doesn't use the generic WARN_ON infrastructure.

Hm, why's that now? The generic infrastructure was taken from powerpc, and I thought I'd converted it...

The definition of "generic" changed midway. When you did the "generic" infrastructure, it was written to use traps for both WARN and BUG. But then somebody didn't like that and added new "generic" infrastructure (the one Arjan is talking about) which doesn't use traps for WARN but rather an unlikely() and an actual function call etc. Then Arjan improved the latter "generic" infrastructure without regard for the original one.

johannes