treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / mips / include / asm / bug.h
blob745dc160a069ff3a9509fe4b00a6e2e22b6690dd
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_BUG_H
3 #define __ASM_BUG_H
5 #include <linux/compiler.h>
6 #include <asm/sgidefs.h>
8 #ifdef CONFIG_BUG
10 #include <asm/break.h>
12 static inline void __noreturn BUG(void)
14 __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
15 unreachable();
18 #define HAVE_ARCH_BUG
20 #if (_MIPS_ISA > _MIPS_ISA_MIPS1)
22 static inline void __BUG_ON(unsigned long condition)
24 if (__builtin_constant_p(condition)) {
25 if (condition)
26 BUG();
27 else
28 return;
30 __asm__ __volatile__("tne $0, %0, %1"
31 : : "r" (condition), "i" (BRK_BUG));
34 #define BUG_ON(C) __BUG_ON((unsigned long)(C))
36 #define HAVE_ARCH_BUG_ON
38 #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
40 #endif
42 #include <asm-generic/bug.h>
44 #endif /* __ASM_BUG_H */