mirror of https://github.com/torvalds/linux.git
bug: Clean up CONFIG_GENERIC_BUG_RELATIVE_POINTERS
Three repeated CONFIG_GENERIC_BUG_RELATIVE_POINTERS #ifdefs right after one another yields unreadable code. Add a helper. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20251110115757.341703850@infradead.org
This commit is contained in:
parent
d292dbb564
commit
30b82568b0
|
|
@ -35,26 +35,20 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
|
|||
|
||||
#ifdef CONFIG_BUG
|
||||
|
||||
#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||
#define BUG_REL(type, name) type name
|
||||
#else
|
||||
#define BUG_REL(type, name) signed int name##_disp
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG
|
||||
struct bug_entry {
|
||||
#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||
unsigned long bug_addr;
|
||||
#else
|
||||
signed int bug_addr_disp;
|
||||
#endif
|
||||
BUG_REL(unsigned long, bug_addr);
|
||||
#ifdef HAVE_ARCH_BUG_FORMAT
|
||||
#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||
const char *format;
|
||||
#else
|
||||
signed int format_disp;
|
||||
#endif
|
||||
BUG_REL(const char *, format);
|
||||
#endif
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
|
||||
const char *file;
|
||||
#else
|
||||
signed int file_disp;
|
||||
#endif
|
||||
BUG_REL(const char *, file);
|
||||
unsigned short line;
|
||||
#endif
|
||||
unsigned short flags;
|
||||
|
|
|
|||
Loading…
Reference in New Issue