linux-stable/scripts
Nathan Chancellor 52f86f3e09 kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1
[ Upstream commit 75b5ab134b ]

Clang enables -Wenum-enum-conversion and -Wenum-compare-conditional
under -Wenum-conversion. A recent change in Clang strengthened these
warnings and they appear frequently in common builds, primarily due to
several instances in common headers but there are quite a few drivers
that have individual instances as well.

  include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
    508 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
        |                            ~~~~~~~~~~~~~~~~~~~~~ ^
    509 |                            item];
        |                            ~~~~

  drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c:955:24: warning: conditional expression between different enumeration types ('enum iwl_mac_beacon_flags' and 'enum iwl_mac_beacon_flags_v1') [-Wenum-compare-conditional]
    955 |                 flags |= is_new_rate ? IWL_MAC_BEACON_CCK
        |                                      ^ ~~~~~~~~~~~~~~~~~~
    956 |                           : IWL_MAC_BEACON_CCK_V1;
        |                             ~~~~~~~~~~~~~~~~~~~~~
  drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c:1120:21: warning: conditional expression between different enumeration types ('enum iwl_mac_beacon_flags' and 'enum iwl_mac_beacon_flags_v1') [-Wenum-compare-conditional]
   1120 |                                                0) > 10 ?
        |                                                        ^
   1121 |                         IWL_MAC_BEACON_FILS :
        |                         ~~~~~~~~~~~~~~~~~~~
   1122 |                         IWL_MAC_BEACON_FILS_V1;
        |                         ~~~~~~~~~~~~~~~~~~~~~~

Doing arithmetic between or returning two different types of enums could
be a bug, so each of the instance of the warning needs to be evaluated.
Unfortunately, as mentioned above, there are many instances of this
warning in many different configurations, which can break the build when
CONFIG_WERROR is enabled.

To avoid introducing new instances of the warnings while cleaning up the
disruption for the majority of users, disable these warnings for the
default build while leaving them on for W=1 builds.

Cc: stable@vger.kernel.org
Closes: https://github.com/ClangBuiltLinux/linux/issues/2002
Link: 8c2ae42b3e
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:28:29 +02:00
..
atomic locking/atomic: scripts: fix fallback ifdeffery 2023-09-20 09:39:03 +02:00
basic
clang-tools gen_compile_commands: fix invalid escape sequence warning 2024-03-26 18:19:11 -04:00
coccinelle Revert "debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage" 2023-07-29 11:05:31 -04:00
dtc dt: dt-extract-compatibles: Don't follow symlinks when walking tree 2023-12-13 18:45:03 +01:00
dummy-tools kbuild: dummy-tools: make MPROFILE_KERNEL checks work on BE 2023-09-01 16:38:04 +09:00
gcc-plugins gcc-plugins: randstruct: Update code comment in relayout_struct() 2023-12-13 18:45:35 +01:00
gdb scripts/gdb: fix lx-device-list-bus and lx-device-list-class 2023-12-13 18:45:19 +01:00
genksyms
kconfig kconfig: fix infinite loop when expanding a macro at the end of file 2024-03-26 18:20:05 -04:00
ksymoops
mod modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS 2024-02-23 09:25:03 +01:00
package kbuild: remove stale code for 'source' symlink in packaging scripts 2023-10-01 23:06:06 +09:00
selinux
tracing
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
Kbuild.include
Kconfig.include kbuild: Add -Wa,--fatal-warnings to as-instr invocation 2024-03-06 14:48:41 +00:00
Lindent
Makefile rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
Makefile.asm-generic
Makefile.build kbuild: rust: avoid creating temporary files 2023-07-24 03:15:31 +09:00
Makefile.clang
Makefile.clean
Makefile.compiler kbuild: Add -Wa,--fatal-warnings to as-instr invocation 2024-03-06 14:48:41 +00:00
Makefile.debug
Makefile.defconf
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-03 15:28:29 +02:00
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host kbuild: rust: avoid creating temporary files 2023-07-24 03:15:31 +09:00
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.kmsan
Makefile.lib
Makefile.modfinal btf, scripts: rust: drop is_rust_module.sh 2023-08-10 22:28:04 +02:00
Makefile.modinst kbuild: Use CRC32 and a 1MiB dictionary for XZ compressed modules 2023-09-25 16:01:05 +09:00
Makefile.modpost linux/export.h: make <linux/export.h> independent of CONFIG_MODULES 2023-07-25 00:59:32 +09:00
Makefile.package kbuild: deb-pkg: support DEB_BUILD_OPTIONS=parallel=N in debian/rules 2023-08-29 22:29:35 +09:00
Makefile.randstruct
Makefile.ubsan
Makefile.userprogs
Makefile.vmlinux x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN 2023-11-28 17:19:36 +00:00
Makefile.vmlinux_o x86/srso: Fix unret validation dependencies 2023-11-20 11:58:52 +01:00
as-version.sh
asn1_compiler.c
bloat-o-meter scripts/bloat-o-meter: count weak symbol sizes 2023-08-21 13:46:25 -07:00
bootgraph.pl
bpf_doc.py bpf, scripts: Correct GPL license name 2024-03-01 13:35:06 +01:00
cc-can-link.sh
cc-version.sh
check-git
check-sysctl-docs
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
checkstack.pl scripts/checkstack.pl: match all stack sizes for s390 2023-12-20 17:01:59 +01:00
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-01-20 11:51:49 +01:00
decodecode
depmod.sh kbuild: move depmod rule to scripts/Makefile.modinst 2023-08-29 22:38:23 +09:00
dev-needs.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen-randstruct-seed.sh
generate_initcall_order.pl
generate_rust_analyzer.py scripts: generate_rust_analyzer: provide `cfg`s for `core` and `alloc` 2023-08-20 22:54:32 +02:00
generate_rust_target.rs
get_abi.pl scripts/get_abi: fix source path leak 2024-01-31 16:18:55 -08:00
get_dvb_firmware
get_feat.pl
get_maintainer.pl
gfp-translate
head-object-list.txt
headerdep.pl
headers_install.sh x86: Remove the arch_calc_vm_prot_bits() macro from the UAPI 2023-09-06 23:50:46 +02:00
insert-sys-cert.c
install.sh
jobserver-exec
kallsyms.c scripts/kallsyms: Fix build failure by setting errno before calling getline() 2023-07-29 15:57:32 +09:00
kernel-doc scripts: kernel-doc: fix macro handling in enums 2023-08-18 11:14:08 -06:00
ld-version.sh
leaking_addresses.pl
link-vmlinux.sh kbuild: Fix changing ELF file type for output of gen_btf for big endian 2024-02-23 09:25:02 +01:00
makelst
markup_oops.pl
min-tool-version.sh rust: upgrade to Rust 1.73.0 2024-02-16 19:10:43 +01:00
misc-check
mkcompile_h
mksysmap kallsyms: ignore ARMv4 thunks along with others 2024-02-23 09:24:59 +01:00
mkuboot.sh
module.lds.S
modules-check.sh
nsdeps
objdiff
objdump-func
orc_hash.sh
pahole-flags.sh
pahole-version.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl
relocs_check.sh
remove-stale-files kbuild: rpm-pkg: rename binkernel.spec to kernel.spec 2023-07-25 00:59:33 +09:00
rust_is_available.sh kbuild: rust_is_available: check that output looks as expected 2023-08-10 01:18:34 +02:00
rust_is_available_bindgen_libclang.h
rust_is_available_test.py kbuild: rust_is_available: add test suite 2023-08-10 01:18:34 +02:00
rustdoc_test_builder.rs rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
rustdoc_test_gen.rs rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
setlocalversion scripts/setlocalversion: also consider annotated tags of the form vx.y.z-${file_localversion} 2023-08-08 01:08:54 +09:00
show_delta
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 17:01:49 +01:00
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spdxexclude
spelling.txt scripts/spelling.txt: remove 'thead' as a typo 2023-07-27 13:07:04 -07:00
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
test_fortify.sh
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh