-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Further -Wundef cases #570
Comments
Looking at one example, Lines 4045 to 4049 in 83d09ad
It seems that this is always defined; for defconfigs I see: $ grep -n BASE_SMALL .config
751:CONFIG_BASE_SMALL=0 so that case is fine. See it's kconfig: Lines 2043 to 2046 in 83d09ad
So ints are probably fine. Here's the latest list on mainline @ 16fc44d $ git grep -nP '^\s*#\s*if\s+CONFIG_[A-Z0-9_]+\s*$' *
arch/microblaze/include/asm/exceptions.h:20:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/include/asm/hash.h:34:#if CONFIG_XILINX_MICROBLAZE0_USE_BARREL
arch/microblaze/include/asm/irqflags.h:12:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/kernel/entry.S:52:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/kernel/entry.S:967:#if CONFIG_MANUAL_RESET_VECTOR
arch/microblaze/kernel/setup.c:149:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/powerpc/platforms/powernv/pci.c:714:#if CONFIG_EEH
arch/x86/boot/compressed/misc.c:175:#if CONFIG_X86_NEED_RELOCS
arch/x86/boot/compressed/misc.h:82:#if CONFIG_RANDOMIZE_BASE
drivers/gpu/drm/i915/gt/sysfs_engines.c:450:#if CONFIG_DRM_I915_HEARTBEAT_INTERVAL
drivers/gpu/drm/i915/gt/sysfs_engines.c:492:#if CONFIG_DRM_I915_HEARTBEAT_INTERVAL
kernel/futex.c:4016:#if CONFIG_BASE_SMALL arch/microblaze/Kconfig.platform: arch/microblaze/Kconfig: arch/powerpc/platforms/Kconfig arch/x86/Kconfig arch/x86/Kconfig drivers/gpu/drm/i915/Kconfig.profile === So only X86_NEED_RELOCS, RANDOMIZE_BASE, and EEH are boolean configs. I wonder if I can repro them with
I will send a patch. |
Sent https://lore.kernel.org/lkml/20210422190450.3903999-1-ndesaulniers@google.com/T/#u for x86. Will post a fix for CONFIG_EEH, too. |
CONFIG_EEH can't be disabled for this file, so it's not possible to get an error out of is. |
While looking at -Wundef warnings, the #if CONFIG_EEH stood out as a possible candidate to convert to #ifdef CONFIG_EEH, but it seems that based on Kconfig dependencies it's not possible to build this file without CONFIG_EEH enabled. Suggested-by: Nathan Chancellor <nathan@kernel.org> Suggested-by: Joe Perches <joe@perches.com> Link: ClangBuiltLinux#570 Link: https://lore.kernel.org/lkml/67f6cd269684c9aa8463ff4812c3b4605e6739c3.camel@perches.com/ Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
But the else case can probably be deleted. Menuconfig for CONFIG_EEH: Sent: https://lore.kernel.org/linuxppc-dev/20210422195405.4053917-1-ndesaulniers@google.com/ |
the x86 patch landed as a554e74. I've pinged the ppc one. |
While looking at -Wundef warnings, the #if CONFIG_EEH stood out as a possible candidate to convert to #ifdef CONFIG_EEH. It seems that based on Kconfig dependencies it's not possible to build this file without CONFIG_EEH enabled, but based on upstream discussion, it's not clear yet that CONFIG_EEH should be enabled by default. For now, simply fix the -Wundef warning. Suggested-by: Nathan Chancellor <nathan@kernel.org> Suggested-by: Joe Perches <joe@perches.com> Link: ClangBuiltLinux#570 Link: https://lore.kernel.org/lkml/67f6cd269684c9aa8463ff4812c3b4605e6739c3.camel@perches.com/ Link: https://lore.kernel.org/lkml/CAOSf1CGoN5R0LUrU=Y=UWho1Z_9SLgCX8s3SbFJXwJXc5BYz4A@mail.gmail.com/ Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
While looking at -Wundef warnings, the #if CONFIG_EEH stood out as a possible candidate to convert to #ifdef CONFIG_EEH. It seems that based on Kconfig dependencies it's not possible to build this file without CONFIG_EEH enabled, but based on upstream discussion, it's not clear yet that CONFIG_EEH should be enabled by default. For now, simply fix the -Wundef warning. Suggested-by: Nathan Chancellor <nathan@kernel.org> Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: ClangBuiltLinux/linux#570 Link: https://lore.kernel.org/lkml/67f6cd269684c9aa8463ff4812c3b4605e6739c3.camel@perches.com/ Link: https://lore.kernel.org/lkml/CAOSf1CGoN5R0LUrU=Y=UWho1Z_9SLgCX8s3SbFJXwJXc5BYz4A@mail.gmail.com/ Link: https://lore.kernel.org/r/20210518204044.2390064-1-ndesaulniers@google.com
Joe Perches pointed out there may be further
-Wundef
warnings lurking.https://lore.kernel.org/lkml/67f6cd269684c9aa8463ff4812c3b4605e6739c3.camel@perches.com/
I will need to look into whether or not these are real config variables (that may be undefined) or ones that are created with a
#define
directive in a C file, which may always be defined and if they can ever be triggered.The text was updated successfully, but these errors were encountered: