arch/x86/include/asm/sighandling.h: In function 'prevent_single_step_upon_eretu':
arch/x86/include/asm/sighandling.h:44:21: error: 'struct pt_regs' has no member named 'fred_ss'
44 | regs->fred_ss.swevent = 0; | ^~
Hmm, this statement is under IS_ENABLED(CONFIG_X86_FRED), which should be a compile time FALSE with i386. Why it is still being compiled?
Because what the compiler is seeing is:
if (0 && ...) regs->fred_ss.swevent = 0;
and the bad field name is found at parse time, while the whole expression is only discarded during optimisation.
The one thing you can't IS_ENABLED() around is conditional fields. That needs to be full #ifdef.
Thanks a lot for the explanation. Just sent out v3 using #ifdef.
Xin