Skip to content

Commit a6d9e26

Browse files
Christoph Hellwigpaul-walmsley-sifive
authored andcommitted
riscv: cleanup <asm/bug.h>
Remove various not required ifdefs and externs. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent 9fe57d8 commit a6d9e26

File tree

1 file changed

+3
-13
lines changed
  • arch/riscv/include/asm

1 file changed

+3
-13
lines changed

arch/riscv/include/asm/bug.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212

1313
#include <asm/asm.h>
1414

15-
#ifdef CONFIG_GENERIC_BUG
1615
#define __INSN_LENGTH_MASK _UL(0x3)
1716
#define __INSN_LENGTH_32 _UL(0x3)
1817
#define __COMPRESSED_INSN_MASK _UL(0xffff)
1918

2019
#define __BUG_INSN_32 _UL(0x00100073) /* ebreak */
2120
#define __BUG_INSN_16 _UL(0x9002) /* c.ebreak */
2221

23-
#ifndef __ASSEMBLY__
2422
typedef u32 bug_insn_t;
2523

2624
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
@@ -43,6 +41,7 @@ typedef u32 bug_insn_t;
4341
RISCV_SHORT " %2"
4442
#endif
4543

44+
#ifdef CONFIG_GENERIC_BUG
4645
#define __BUG_FLAGS(flags) \
4746
do { \
4847
__asm__ __volatile__ ( \
@@ -58,14 +57,10 @@ do { \
5857
"i" (flags), \
5958
"i" (sizeof(struct bug_entry))); \
6059
} while (0)
61-
62-
#endif /* !__ASSEMBLY__ */
6360
#else /* CONFIG_GENERIC_BUG */
64-
#ifndef __ASSEMBLY__
6561
#define __BUG_FLAGS(flags) do { \
6662
__asm__ __volatile__ ("ebreak\n"); \
6763
} while (0)
68-
#endif /* !__ASSEMBLY__ */
6964
#endif /* CONFIG_GENERIC_BUG */
7065

7166
#define BUG() do { \
@@ -79,15 +74,10 @@ do { \
7974

8075
#include <asm-generic/bug.h>
8176

82-
#ifndef __ASSEMBLY__
83-
8477
struct pt_regs;
8578
struct task_struct;
8679

87-
extern void die(struct pt_regs *regs, const char *str);
88-
extern void do_trap(struct pt_regs *regs, int signo, int code,
89-
unsigned long addr);
90-
91-
#endif /* !__ASSEMBLY__ */
80+
void die(struct pt_regs *regs, const char *str);
81+
void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr);
9282

9383
#endif /* _ASM_RISCV_BUG_H */

0 commit comments

Comments
 (0)