linux-stable/scripts
Nathan Chancellor b046ab1642 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-13 12:51:26 +02:00
..
atomic locking/atomics: Use sed(1) instead of non-standard head(1) option 2019-06-25 10:17:07 +02:00
basic kbuild: remove unneeded comments and code from scripts/basic/Makefile 2019-08-29 23:54:29 +09:00
coccinelle scripts: add dummy report mode to add_namespace.cocci 2020-08-11 15:33:35 +02:00
dtc scripts/dtc: dtx_diff: remove broken example from help text 2022-01-27 09:19:55 +01:00
gcc-plugins randstruct: Fix gcc-plugin performance mode to stay in group 2023-11-28 16:50:17 +00:00
gdb scripts/gdb: fix lx-timerlist for Python3 2023-05-17 11:35:55 +02:00
genksyms genksyms: convert to SPDX License Identifier for lex.l and parse.y 2019-09-14 11:40:13 +09:00
kconfig kconfig: fix infinite loop when expanding a macro at the end of file 2024-03-26 18:22:24 -04:00
ksymoops
mod modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host 2023-11-20 10:30:14 +01:00
package kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-09-03 11:27:10 +02:00
selinux selinux: use "grep -E" instead of "egrep" 2022-10-26 13:22:21 +02:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-06 07:52:44 +01:00
.gitignore scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore 2018-12-22 00:37:52 +09:00
Kbuild.include kbuild: remove the target in signal traps when interrupted 2022-10-26 13:22:46 +02:00
Kconfig.include kconfig: introduce m32-flag and m64-flag 2020-04-08 09:08:37 +02:00
Lindent
Makefile scripts: set proper OpenSSL include dir also for sign-file 2021-02-26 10:10:27 +01:00
Makefile.asm-generic kbuild: force all architectures except um to include mandatory-y 2019-03-17 12:56:32 +09:00
Makefile.build kbuild: Fix objtool dependency for 'OBJECT_FILES_NON_STANDARD_<obj> := n' 2021-07-14 16:53:20 +02:00
Makefile.clean kbuild: clean up subdir-ymn calculation in Makefile.clean 2019-08-29 23:54:29 +09:00
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-13 12:51:26 +02:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-25 11:18:31 +02:00
Makefile.headersinst kbuild: move headers_check rule to usr/include/Makefile 2020-03-05 16:43:47 +01:00
Makefile.host kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
Makefile.kasan kasan/arm64: fix CONFIG_KASAN_SW_TAGS && KASAN_INLINE 2019-08-15 13:24:04 +01:00
Makefile.kcov treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile.lib kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-09-03 11:27:10 +02:00
Makefile.modbuiltin kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin} 2019-07-17 22:39:27 +09:00
Makefile.modfinal kbuild: move modkern_{c,a}flags to Makefile.lib from Makefile.build 2019-08-22 01:14:11 +09:00
Makefile.modinst kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod 2019-07-17 22:39:27 +09:00
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-09-05 10:27:45 +02:00
Makefile.modsign kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod 2019-07-17 22:39:27 +09:00
Makefile.package kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2020-09-03 11:27:10 +02:00
Makefile.ubsan ubsan: Remove vla bound checks. 2019-05-06 11:12:09 -07:00
adjust_autoksyms.sh kbuild: remove the first line of *.mod files 2019-07-18 02:19:31 +09:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 11:24:06 +02:00
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-05-22 11:38:30 +02:00
bootgraph.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 391 2019-06-05 17:37:11 +02:00
bpf_helpers_doc.py scripts/bpf: Fix xdp_md forward declaration typo 2024-03-01 13:13:38 +01:00
cc-can-link.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
checkpatch.pl checkpatch: fix unescaped left brace 2020-12-30 11:51:27 +01:00
checkstack.pl scripts/checkstack.pl: Fix arm64 wrong or unknown architecture 2019-06-05 02:33:10 +09:00
checksyscalls.sh checksyscalls: fix up mq_timedreceive and stat exceptions 2019-02-19 21:27:53 +01:00
checkversion.pl
clang-version.sh kbuild: update comment block of scripts/clang-version.sh 2019-03-04 22:34:54 +09:00
cleanfile
cleanpatch
coccicheck
config tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
conmakehash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 54 2019-05-24 17:36:42 +02:00
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace: strip basepath from all paths 2020-07-29 10:18:35 +02:00
decodecode scripts/decodecode: fix trapping instruction formatting 2020-05-14 07:58:29 +02:00
depmod.sh depmod: handle the case of /sbin/depmod without /sbin in PATH 2021-01-12 20:16:10 +01:00
diffconfig scripts: switch explicitly to Python 3 2021-05-22 11:38:30 +02:00
documentation-file-ref-check scripts/documentation-file-ref-check: ignore output dir 2019-06-14 14:43:01 -06:00
export_report.pl modpost: move the namespace field in Module.symvers last 2020-03-25 08:25:55 +01:00
extract-cert.c cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-25 17:42:10 +01:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378 2019-06-05 17:37:10 +02:00
extract_xc3028.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 339 2019-06-05 17:37:07 +02:00
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-12-08 11:23:02 +01:00
file-size.sh
find-unused-docs.sh scripts/find-unused-docs: Fix massive false positives 2020-02-11 04:35:23 -08:00
gcc-goto.sh jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
gcc-ld
gcc-plugin.sh
gcc-version.sh kbuild: clean up scripts/gcc-version.sh 2019-03-04 22:35:04 +09:00
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_compile_commands.py gen_compile_commands: lower the entry count threshold 2019-07-27 12:18:19 +09:00
gen_ksymdeps.sh kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y 2021-09-22 12:26:26 +02:00
get_abi.pl tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
get_dvb_firmware treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
get_maintainer.pl get_maintainer: add ability to skip moderated mailing lists 2019-07-16 19:23:22 -07:00
gfp-translate treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
headerdep.pl
headers_check.pl
headers_install.sh scripts: headers_install: Exit with error on config leak 2020-06-24 17:50:33 +02:00
insert-sys-cert.c
kallsyms.c scripts/kallsyms: fix definitely-lost memory leak 2020-01-04 19:18:23 +01:00
kernel-doc kernel-doc: Allow anonymous enum 2019-08-12 15:00:37 -06:00
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-11-17 09:48:31 +01:00
link-vmlinux.sh kbuild: Fix changing ELF file type for output of gen_btf for big endian 2024-02-23 08:25:10 +01:00
makelst
markup_oops.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 373 2019-06-05 17:37:10 +02:00
mkcompile_h kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-07-25 14:35:12 +02:00
mkmakefile kbuild: get rid of $(realpath ...) from scripts/mkmakefile 2019-08-29 23:54:29 +09:00
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-09-28 11:03:59 +02:00
mkuboot.sh
module-common.lds
modules-check.sh kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin} 2019-07-17 22:39:27 +09:00
namespace.pl namespace: fix namespace.pl script to support relative paths 2019-10-05 15:29:49 +09:00
nsdeps scripts: add dummy report mode to add_namespace.cocci 2020-08-11 15:33:35 +02:00
objdiff treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 199 2019-05-30 11:29:23 -07:00
parse-maintainers.pl parse-maintainers: Mark as executable 2020-03-25 08:25:49 +01:00
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-30 12:44:04 +01:00
recordmcount.h recordmcount: Correct st_shndx handling 2021-06-30 08:47:49 -04:00
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:37:44 +01:00
setlocalversion scripts/setlocalversion: make git describe output more reliable 2020-11-01 12:01:01 +01:00
show_delta tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:41:17 +01:00
sortextable.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378 2019-06-05 17:37:10 +02:00
sortextable.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378 2019-06-05 17:37:10 +02:00
spdxcheck-test.sh scripts: add spdxcheck.py self test 2018-12-28 12:11:44 -08:00
spdxcheck.py spdxcheck.py: fix directory structures 2019-06-01 15:51:31 -07:00
spelling.txt scripts/spelling.txt: add more spellings to spelling.txt 2019-07-12 11:05:41 -07:00
sphinx-pre-install tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
split-man.pl tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-27 08:37:03 +02:00
tools-support-relr.sh Makefile: fix GDB warning with CONFIG_RELR 2021-07-14 16:53:12 +02:00
unifdef.c
ver_linux ver_linux: Assign constant RE to variable name for clarity 2019-01-22 13:34:35 +01:00
xen-hypercalls.sh
xz_wrap.sh kbuild: add variables for compression tools 2020-09-03 11:27:10 +02:00