Skip to content

Commit

Permalink
CRISv32: add unreachable() to BUG()
Browse files Browse the repository at this point in the history
Add an unreachable() in the BUG() implementations, to get rid of
several warnings similar to the one below:

 kernel/sched/core.c: In function 'pick_next_task':
 kernel/sched/core.c:2690:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Rabin Vincent <[email protected]>
Signed-off-by: Jesper Nilsson <[email protected]>
  • Loading branch information
vitkyrka authored and Jesper Nilsson committed Sep 4, 2015
1 parent 6a4756f commit 98a725a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions arch/cris/include/arch-v32/arch/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* All other stuff is done out-of-band with exception handlers.
*/
#define BUG() \
do { \
__asm__ __volatile__ ("0: break 14\n\t" \
".section .fixup,\"ax\"\n" \
"1:\n\t" \
Expand All @@ -21,9 +22,15 @@
".section __ex_table,\"a\"\n\t" \
".dword 0b, 1b\n\t" \
".previous\n\t" \
: : "ri" (__FILE__), "i" (__LINE__))
: : "ri" (__FILE__), "i" (__LINE__)); \
unreachable(); \
} while (0)
#else
#define BUG() __asm__ __volatile__ ("break 14\n\t")
#define BUG() \
do { \
__asm__ __volatile__ ("break 14\n\t"); \
unreachable(); \
} while (0)
#endif

#define HAVE_ARCH_BUG
Expand Down

0 comments on commit 98a725a

Please sign in to comment.