More unreachable() conversions.
cover More unreachable() conversions.
Back in commit 38938c879eb0c39edf85d5164aa0cffe2874304c the new macro unreachable() was added. We can use it in BUG instead of a variety of ad hoc endless loops.
This patch set consists of the patches from the original set that were never Acked-by anyone. Although they are completely untested, they seem plausible.
I don't plan on pushing these things out any more, so if you like them please merge them via your architecture trees.
I will reply with the 5 patches.
David Daney (5):
mn10300: Convert BUG() to use unreachable()
parisc: Convert BUG() to use unreachable()
powerpc: Convert BUG() to use unreachable()
alpha: Convert BUG() to use unreachable()
blackfin: Convert BUG() to use unreachable()
arch/alpha/include/asm/bug.h | 3 ++- arch/blackfin/include/asm/bug.h | 2 +- arch/mn10300/include/asm/bug.h | 3 ++- arch/parisc/include/asm/bug.h | 4 ++-- arch/powerpc/include/asm/bug.h | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-)
PATCH 1/5 mn10300: Convert BUG() to use unreachable()
Use the new unreachable() macro instead of while(1).
--- arch/mn10300/include/asm/bug.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mn10300/include/asm/bug.h +2 -1
@@ -27,7 +27,8 @@ do { \ : \ : "i"(__FILE__), "i"(__LINE__) \ ); \ -} while (1) +unreachable (); \ +} while (0)#define HAVE_ARCH_BUG #endif /* CONFIG_BUG */
Signature · 1 line
1.6.2.5
PATCH 2/5 parisc: Convert BUG() to use unreachable()
In reply to David DaneyUse the new unreachable() macro instead of for(;;);
--- arch/parisc/include/asm/bug.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/parisc/include/asm/bug.h +2 -2
@@ -32,14 +32,14 @@ "\t.popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (0), "i" (sizeof(struct bug_entry)) ); \ -for (;;) ; \ +unreachable (); \ } while(0) #else#define BUG () \ do { \ asm volatile(PARISC_BUG_BREAK_ASM : : ); \ - for(;;) ; \ + unreachable(); \ } while(0)#endif
Signature · 1 line
1.6.2.5
PATCH 4/5 alpha: Convert BUG() to use unreachable()
In reply to David DaneyUse the new unreachable() macro instead of for(;;);
--- arch/alpha/include/asm/bug.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/alpha/include/asm/bug.h +2 -1
@@ -13,7 +13,8 @@ "call_pal %0 # bugchk\n\t" \ ".long %1\n\t.8byte %2" \ : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ - for ( ; ; ); } while (0) +unreachable (); \ + } while (0)#define HAVE_ARCH_BUG #endif
Signature · 1 line
1.6.2.5
PATCH 5/5 blackfin: Convert BUG() to use unreachable()
In reply to David DaneyUse the new unreachable() macro instead of for(;;);
--- arch/blackfin/include/asm/bug.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/include/asm/bug.h +1 -1
@@ -47,7 +47,7 @@#define BUG () \ do { \ _BUG_OR_WARN(0); \ - for (;;); \ + unreachable(); \ } while (0)#define WARN_ON (condition) \
Signature · 1 line
1.6.2.5
PATCH 3/5 powerpc: Convert BUG() to use unreachable()
In reply to David DaneyUse the new unreachable() macro instead of for(;;);
--- arch/powerpc/include/asm/bug.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/bug.h +1 -1
@@ -68,7 +68,7 @@ _EMIT_BUG_ENTRY \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (0), "i" (sizeof(struct bug_entry))); \ -for (;;) ; \ +unreachable (); \ } while (0)#define BUG_ON (x) do { \
Signature · 1 line
1.6.2.5
Re: [Uclinux-dist-devel] [PATCH 5/5] blackfin: Convert BUG() to use unreachable()
In reply to David DaneyQuoted 1 line · David Daney
Use the new
unreachable()macro instead of for(;;);
sorry, i guess i missed this back in Sept. change looks fine to me (i'll test it later when finishing putting together other patches). you want me to push though my queue ? doesnt matter to me. -mike
Re: [Uclinux-dist-devel] [PATCH 5/5] blackfin: Convert BUG() to use unreachable()
Quoted 6 lines · Mike Frysinger
Quoted 1 line · David Daney
Use the new
unreachable()macro instead of for(;;);sorry, i guess i missed this back in Sept. change looks fine to me (i'll test it later when finishing putting together other patches). you want me to push though my queue ? doesnt matter to me.
Yes, if you test it and are happy with it. I have no queue and plan no further action.
David Daney
Re: [PATCH 2/5] parisc: Convert BUG() to use unreachable()
In reply to David DaneyQuoted 7 lines · David Daney
Use the new
unreachable()macro instead of for(;;);Signed-off-by David Daney <[email protected]>CC Kyle McMartin <[email protected]>CC Helge Deller <[email protected]>---
Thanks David, I'll bash this into my tree now that the macro is upstream.
regards, Kyle
Re: [Uclinux-dist-devel] [PATCH 5/5] blackfin: Convert BUG() to use unreachable()
In reply to David DaneyQuoted 10 lines · David Daney
Quoted 6 lines · Mike Frysinger
Quoted 1 line · David Daney
Use the new
unreachable()macro instead of for(;;);sorry, i guess i missed this back in Sept. change looks fine to me (i'll test it later when finishing putting together other patches). you want me to push though my queue ? doesnt matter to me.
Yes, if you test it and are happy with it. I have no queue and plan no further action.
rgr
-mike
Matt Turner
maintainerRe: [PATCH 4/5] alpha: Convert BUG() to use unreachable()
In reply to David DaneyQuoted 26 lines · David Daney
Use the new
unreachable()macro instead of for(;;);Signed-off-by David Daney <[email protected]>CC Richard Henderson <[email protected]>CC Ivan Kokshaysky <[email protected]>CC Matt Turner <[email protected]>---
arch/alpha/include/asm/bug.h | 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)arch/alpha/include/asm/bug.h +2
-2@@ -13,7 +13,8 @@ "call_pal %0 # bugchk\n\t" \ ".long %1\n\t.8byte %2" \ : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ - for ( ; ; ); } while (0) + unreachable(); \ + } while (0) #define HAVE_ARCH_BUG #endif --
Quoted 1 line
1.6.2.5
Thanks David. I've pushed this into my tree.
Matt