On 28/05/2025 1:43 pm, Roger Pau Monné wrote: > On Tue, May 27, 2025 at 04:09:11PM +0100, Andrew Cooper wrote: >> None of these are used by traps.c today. >> >> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> > Acked-by: Roger Pau Monné <roger....@citrix.com>
Thanks. >> --- >> CC: Jan Beulich <jbeul...@suse.com> >> CC: Roger Pau Monné <roger....@citrix.com> >> >> I'm experimenting with include-what-you-use but it's not the most >> ergonomic of tools to use. > Does include-what-you-use take into account #ifdef sections? I'm > wondering whether non-default Kconfig could require extra headers that > are not accounted for the tool? Testing suggests that it does a normal preprocessor pass first. Given: #include <xen/bitops.h> #if 0 void *ptr = NULL; #endif the report suggests: arch/x86/iwyu.c should add these lines: arch/x86/iwyu.c should remove these lines: - #include <xen/bitops.h> // lines 1-1 The full include-list for arch/x86/iwyu.c: --- and does not make the recommendation to include <xen/types.h> to get NULL. For traps.c, grep -e '#ifdef' -e '#.*defined(' -e "IS_ENABLED" arch/x86/traps.c #ifdef NDEBUG #ifdef CONFIG_PV32 #ifdef CONFIG_HVM #ifdef CONFIG_XEN_SHSTK #if !defined(CONFIG_FRAME_POINTER) if ( IS_ENABLED(CONFIG_XEN_SHSTK) ) if ( IS_ENABLED(CONFIG_DEBUG) && print ) #ifdef CONFIG_PV #ifdef CONFIG_PV #ifdef CONFIG_PV #ifdef CONFIG_PV if ( IS_ENABLED(CONFIG_PV) && ret == EXCRET_fault_fixed ) #ifdef CONFIG_PV #ifdef CONFIG_PV #ifdef CONFIG_PV #ifdef CONFIG_DEBUG and each of HVM, PV and PV32 and XEN_SHSTK are active in the analysis I did. NDEBUG, CONFIG_DEBUG and CONFIG_FRAME_POINTER aren't doing anything interesting here. So I think this patch for traps.c is accurate. setup.c is far less certain, and I'll need to do some more analysis before committing that. ~Andrew