--- zzzz-none-000/linux-4.1.52/include/linux/bug.h 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/include/linux/bug.h 2022-03-02 11:37:13.000000000 +0000 @@ -81,7 +81,17 @@ * build time, you should use BUILD_BUG to detect if it is * unexpectedly used. */ +#if defined(CONFIG_BCM_KF_BUZZZ) && defined(CONFIG_BUZZZ_FUNC) && defined(BUZZZ_O0) +/** + * When compiled with -O0 to disable inlining, compile time constant evaluation + * (of size parameter) in several inline kernel function will result in a + * switch default case implemented as a BUILD_BUG(). + * E.g. include/asm percpu.h __percpi_##op(), cmpxchg.h __xchg(), ... + */ +#define BUILD_BUG() do { } while (0) +#else #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") +#endif #endif /* __CHECKER__ */ @@ -102,8 +112,9 @@ #else /* !CONFIG_GENERIC_BUG */ -static inline enum bug_trap_type report_bug(unsigned long bug_addr, - struct pt_regs *regs) +static inline enum bug_trap_type report_bug( + unsigned long bug_addr __maybe_unused, + struct pt_regs *regs __maybe_unused) { return BUG_TRAP_TYPE_BUG; }