linux-stable/scripts
Nathan Chancellor 32eaf695d3 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:19:34 +02:00
..
atomic Fix up more non-executable files marked executable 2023-02-01 08:34:49 +01:00
basic randstruct: Move seed generation into scripts/basic/ 2022-05-08 01:33:07 -07:00
clang-tools gen_compile_commands: fix invalid escape sequence warning 2024-03-26 18:20:25 -04:00
coccinelle update Coccinelle URL 2022-08-07 21:30:36 +02:00
dtc dt: dt-extract-compatibles: Don't follow symlinks when walking tree 2023-12-13 18:39:05 +01:00
dummy-tools kbuild: dummy-tools: pretend we understand __LONG_DOUBLE_128__ 2022-08-21 02:47:48 +09:00
gcc-plugins randstruct: Fix gcc-plugin performance mode to stay in group 2023-11-28 17:07:07 +00:00
gdb scripts/gdb: fix lx-timerlist for Python3 2023-05-11 23:03:40 +09:00
genksyms genksyms: adjust the output format to modpost 2022-05-24 16:33:20 +09:00
kconfig kconfig: fix infinite loop when expanding a macro at the end of file 2024-03-26 18:20:58 -04:00
ksymoops
mod modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS 2024-02-23 09:12:38 +01:00
package kbuild: rpm-pkg: define _arch conditionally 2023-09-19 12:27:58 +02:00
selinux selinux: remove runtime disable message in the install_policy.sh script 2022-09-20 14:12:25 -04:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-01 08:34:37 +01:00
.gitignore scripts: add `generate_rust_target.rs` 2022-09-28 09:02:06 +02:00
Kbuild.include kbuild: remove the target in signal traps when interrupted 2022-09-29 02:00:29 +09:00
Kconfig.include kbuild: Update assembler calls to use proper flags and language target 2023-06-21 16:01:03 +02:00
Lindent
Makefile Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
Makefile.asm-generic
Makefile.build kbuild: add -fno-discard-value-names to cmd_cc_ll_c 2022-10-15 05:22:29 +09:00
Makefile.clang um: Allow builds with Clang 2022-03-21 08:13:03 -07:00
Makefile.clean kbuild: drop $(objtree)/ prefix support for clean-files 2022-05-08 03:17:00 +09:00
Makefile.compiler powerpc: remove checks for binutils older than 2.25 2024-01-25 15:27:18 -08:00
Makefile.debug Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-03 15:19:34 +02:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-16 12:25:53 -07:00
Makefile.headersinst
Makefile.host Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.kmsan kmsan: add KMSAN runtime core 2022-10-03 14:03:19 -07:00
Makefile.lib - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
Makefile.modfinal kbuild: Disable GCOV for *.mod.o 2023-07-19 16:21:44 +02:00
Makefile.modinst kbuild: modinst: Fix build error when CONFIG_MODULE_SIG_KEY is a PKCS#11 URI 2023-02-09 11:28:11 +01:00
Makefile.modpost modpost: propagate W=1 build option to modpost 2024-02-23 09:12:38 +01:00
Makefile.package scripts: add rust in scripts/Makefile.package 2022-11-24 09:27:57 +09:00
Makefile.randstruct randstruct: Enable Clang support 2022-05-08 01:33:07 -07:00
Makefile.ubsan ubsan: remove CONFIG_UBSAN_OBJECT_SIZE 2022-01-20 08:52:55 +02:00
Makefile.userprogs
Makefile.vmlinux kbuild: rebuild .vmlinux.export.o when its prerequisite is updated 2022-10-03 03:52:58 +09:00
Makefile.vmlinux_o kbuild: move modules.builtin(.modinfo) rules to Makefile.vmlinux_o 2022-10-03 03:52:58 +09:00
adjust_autoksyms.sh kbuild: split the second line of *.mod into *.usyms 2022-05-08 03:16:59 +09:00
as-version.sh kbuild: Update assembler calls to use proper flags and language target 2023-06-21 16:01:03 +02:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 14:28:44 +02:00
bin2c.c
bloat-o-meter scripts/bloat-o-meter: add -p argument 2022-07-17 17:31:40 -07:00
bootgraph.pl
bpf_doc.py bpf, scripts: Correct GPL license name 2024-03-01 13:26:35 +01:00
cc-can-link.sh
cc-version.sh Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
check-local-export kbuild: rewrite check-local-export in sh/awk 2022-09-29 04:40:15 +09:00
check-sysctl-docs
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py scripts: handle BrokenPipeError for python scripts 2023-03-17 08:50:31 +01:00
checkpatch.pl locking: Introduce __cleanup() based infrastructure 2024-02-23 09:12:51 +01:00
checkstack.pl checkstack: fix printed address 2023-12-13 18:39:19 +01:00
checksyscalls.sh checksyscalls: ignore -Wunused-macros 2022-05-08 03:16:59 +09:00
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch const_structs.checkpatch: add frequently used ops structs 2022-01-20 08:52:54 +02:00
decode_stacktrace.sh scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-01-20 11:50:11 +01:00
decodecode scripts/decodecode: improve faulting line determination 2022-09-11 21:55:05 -07:00
depmod.sh
dev-needs.sh
diffconfig scripts: handle BrokenPipeError for python scripts 2023-03-17 08:50:31 +01:00
documentation-file-ref-check
export_report.pl
extract-ikconfig scripts/extract-ikconfig: add zstd compression support 2022-08-29 13:58:47 +09:00
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-11-16 10:42:10 +01:00
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 randstruct: Move seed generation into scripts/basic/ 2022-05-08 01:33:07 -07:00
gen_autoksyms.sh kbuild: Ignore __this_module in gen_autoksyms.sh 2022-06-26 06:15:05 +09:00
gen_ksymdeps.sh
generate_initcall_order.pl
generate_rust_analyzer.py scripts: add `generate_rust_analyzer.py` 2022-09-28 09:02:06 +02:00
generate_rust_target.rs x86: enable initial Rust support 2022-09-28 09:02:45 +02:00
get_abi.pl scripts/get_abi: fix source path leak 2024-01-31 16:17:01 -08:00
get_dvb_firmware
get_feat.pl scripts: get_feat.pl: use /usr/bin/env to find perl 2022-06-30 12:22:17 -06:00
get_maintainer.pl get_maintainer: Honor mailmap for in file emails 2022-04-29 14:38:00 -07:00
gfp-translate scripts: fix the gfp flags header path in gfp-translate 2023-06-28 11:12:22 +02:00
head-object-list.txt arm64: remove special treatment for the link order of head.o 2023-02-25 11:25:42 +01:00
headerdep.pl
headers_install.sh scripts: headers_install.sh: Update config leak ignore entries 2022-07-27 21:18:00 +09:00
insert-sys-cert.c
install.sh kbuild: factor out the common installation code into scripts/install.sh 2022-05-11 21:45:53 +09:00
is_rust_module.sh scripts: add `is_rust_module.sh` 2022-09-28 09:02:06 +02:00
jobserver-exec
kallsyms.c kallsyms: Reduce the memory occupied by kallsyms_seqs_of_names[] 2023-10-25 12:03:16 +02:00
kernel-doc scripts: kernel-doc: Always increment warnings counter 2022-06-13 11:07:45 -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:12:37 +01:00
makelst
markup_oops.pl
min-tool-version.sh scripts/min-tool-version.sh: raise minimum clang version to 15.0.0 for s390 2022-11-09 18:41:16 +01:00
mkcompile_h Revert "kbuild: Make scripts/compile.h when sh != bash" 2022-09-29 04:40:15 +09:00
mksysmap kallsyms: ignore __kstrtab_* and __kstrtabns_* symbols 2022-10-03 03:51:58 +09:00
mkuboot.sh
module.lds.S cfi: Switch to -fsanitize=kcfi 2022-09-26 10:13:13 -07:00
modules-check.sh
nsdeps scripts/nsdeps: adjust to the format change of *.mod files 2022-06-08 20:14:13 +09:00
objdiff kbuild: clean .tmp_* pattern by make clean 2022-06-05 06:20:57 +09:00
objdump-func scripts: Create objdump-func helper script 2022-05-12 10:08:43 -07:00
pahole-flags.sh bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25 2024-01-20 11:50:10 +01:00
pahole-version.sh kbuild: Add CONFIG_PAHOLE_VERSION 2022-02-02 11:19:33 +01:00
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel scripts/prune-kernel: Use kernel-install if available 2022-05-11 21:46:38 +09:00
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-24 17:32:41 +01:00
recordmcount.h
recordmcount.pl nds32: Remove the architecture 2022-03-07 13:54:59 +01:00
remove-stale-files RISC-V Patches for the 5.20 Merge Window, Part 2 2022-08-12 18:39:43 -07:00
rust_is_available.sh kbuild: rust_is_available: fix confusion when a version appears in the path 2023-09-13 09:42:32 +02:00
rust_is_available_bindgen_libclang.h scripts: add `rust_is_available.sh` 2022-09-28 09:02:06 +02:00
setlocalversion
show_delta
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 17:00:19 +01:00
sorttable.c LoongArch: Add ELF-related definitions 2022-06-03 20:09:27 +08:00
sorttable.h script/sorttable: Fix some initialization problems 2022-01-18 10:17:18 -05:00
spdxcheck-test.sh docs: move Linux logo into a new `images` folder 2022-06-01 09:32:45 -06:00
spdxcheck.py scripts/spdxcheck: Put excluded files and directories into a separate file 2022-05-18 15:34:33 +02:00
spdxexclude scripts/spdxcheck: Exclude top-level README 2022-05-18 15:35:42 +02:00
spelling.txt scripts/spelling.txt: add more spellings to spelling.txt 2022-03-22 15:57:00 -07:00
sphinx-pre-install scripts: sphinx-pre-install: place a warning for Sphinx >= 3.0 2022-07-07 12:47:34 -06:00
split-man.pl
stackdelta
stackusage
subarch.include LoongArch: Add build infrastructure 2022-06-03 20:09:27 +08:00
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-05 18:27:38 +01:00
test_fortify.sh fortify: Update compile-time tests for Clang 14 2022-02-13 16:50:06 -08:00
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh