Patchwork [U-Boot,09/21] blackfin: Replace "bfin_reset_or_hang()" with "panic()"

login
register
mail settings
Submitter Kyle Moffett
Date March 7, 2011, 5:37 p.m.
Message ID <1299519462-25320-10-git-send-email-Kyle.D.Moffett@boeing.com>
Download mbox | patch
Permalink /patch/85775/
State Accepted
Headers show

Comments

Kyle Moffett - March 7, 2011, 5:37 p.m.
The bfin_reset_or_hang function unnecessarily duplicates the panic()
logic based on CONFIG_PANIC_HANG.

This patch deletes 20 lines of code and just calls panic() instead.
This also makes the following generic-restart conversion patch simpler.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/cpu/cpu.h   |    1 -
 arch/blackfin/cpu/reset.c |   19 +------------------
 arch/blackfin/cpu/traps.c |    2 +-
 3 files changed, 2 insertions(+), 20 deletions(-)
Mike Frysinger - March 7, 2011, 9:44 p.m.
On Monday, March 07, 2011 12:37:30 Kyle Moffett wrote:
> The bfin_reset_or_hang function unnecessarily duplicates the panic()
> logic based on CONFIG_PANIC_HANG.
> 
> This patch deletes 20 lines of code and just calls panic() instead.

hmm, didnt even realize this func existed in u-boot.  i'll merge this one 
patch through my tree in the next window since it doesnt rely on anything else 
in this series.
-mike

Patch

diff --git a/arch/blackfin/cpu/cpu.h b/arch/blackfin/cpu/cpu.h
index ba85e0b..e70560f 100644
--- a/arch/blackfin/cpu/cpu.h
+++ b/arch/blackfin/cpu/cpu.h
@@ -28,7 +28,6 @@ 
 #include <command.h>
 
 void board_reset(void) __attribute__((__weak__));
-void bfin_reset_or_hang(void) __attribute__((__noreturn__));
 void bfin_dump(struct pt_regs *reg);
 void bfin_panic(struct pt_regs *reg);
 void dump(struct pt_regs *regs);
diff --git a/arch/blackfin/cpu/reset.c b/arch/blackfin/cpu/reset.c
index 164afde..49d0cf8 100644
--- a/arch/blackfin/cpu/reset.c
+++ b/arch/blackfin/cpu/reset.c
@@ -80,27 +80,10 @@  static void bfin_reset(void)
  * PC relative call with a 25 bit immediate.  This is not enough
  * to get us from the top of SDRAM into L1.
  */
-__attribute__ ((__noreturn__))
-static inline void bfin_reset_trampoline(void)
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (board_reset)
 		board_reset();
 	while (1)
 		asm("jump (%0);" : : "a" (bfin_reset));
 }
-
-__attribute__ ((__noreturn__))
-void bfin_reset_or_hang(void)
-{
-#ifdef CONFIG_PANIC_HANG
-	hang();
-#else
-	bfin_reset_trampoline();
-#endif
-}
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	bfin_reset_trampoline();
-	return 0;
-}
diff --git a/arch/blackfin/cpu/traps.c b/arch/blackfin/cpu/traps.c
index 09388aa..0cb833a 100644
--- a/arch/blackfin/cpu/traps.c
+++ b/arch/blackfin/cpu/traps.c
@@ -426,5 +426,5 @@  void bfin_panic(struct pt_regs *regs)
 	unsigned long tflags;
 	trace_buffer_save(tflags);
 	bfin_dump(regs);
-	bfin_reset_or_hang();
+	panic("PANIC: Blackfin internal error");
 }