# git rev-parse -q --verify d936eb23874433caa3e3d841cfa16f5434b85dcf^{commit} d936eb23874433caa3e3d841cfa16f5434b85dcf already have revision, skipping fetch # git checkout -q -f -B kisskb d936eb23874433caa3e3d841cfa16f5434b85dcf # git clean -qxdf # < git log -1 # commit d936eb23874433caa3e3d841cfa16f5434b85dcf # Author: Linus Torvalds # Date: Thu Jul 15 18:05:31 2021 -0700 # # Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" # # This reverts commit b7eb335e26a9c7f258c96b3962c283c379d3ede0. # # It turns out that the problem with the clang -Wimplicit-fallthrough # warning is not about the kernel source code, but about clang itself, and # that the warning is unusable until clang fixes its broken ways. # # In particular, when you enable this warning for clang, you not only get # warnings about implicit fallthroughs. You also get this: # # warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough] # # which is completely broken becasue it # # (a) doesn't even tell you where the problem is (seriously: no line # numbers, no filename, no nothing). # # (b) is fundamentally broken anyway, because there are perfectly valid # reasons to have a fallthrough statement even if it turns out that # it can perhaps not be reached. # # In the kernel, an example of that second case is code in the scheduler: # # switch (state) { # case cpuset: # if (IS_ENABLED(CONFIG_CPUSETS)) { # cpuset_cpus_allowed_fallback(p); # state = possible; # break; # } # fallthrough; # case possible: # # where if CONFIG_CPUSETS is enabled you actually never hit the # fallthrough case at all. But that in no way makes the fallthrough # wrong. # # So the warning is completely broken, and enabling it for clang is a very # bad idea. # # In the meantime, we can keep the gcc option enabled, and make the gcc # build use # # -Wimplicit-fallthrough=5 # # which means that we will at least continue to require a proper # fallthrough statement, and that gcc won't silently accept the magic # comment versions. Because gcc does this all correctly, and while the odd # "=5" part is kind of obscure, it's documented in [1]: # # "-Wimplicit-fallthrough=5 doesn’t recognize any comments as # fallthrough comments, only attributes disable the warning" # # so if clang ever fixes its bad behavior we can try enabling it there again. # # Link: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [1] # Cc: Kees Cook # Cc: Gustavo A. R. Silva # Cc: Nathan Chancellor # Cc: Nick Desaulniers # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux-gcc --version # < /opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux-ld --version # < git log --format=%s --max-count=1 d936eb23874433caa3e3d841cfa16f5434b85dcf # < make -s -j 24 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # < make -s -j 24 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- help # make -s -j 24 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- olddefconfig # make -s -j 24 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- /kisskb/src/drivers/input/joystick/analog.c:160:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] #warning Precise timer not defined for this architecture. ^ /kisskb/src/drivers/gpu/drm/rockchip/cdn-dp-core.c:1126:12: warning: 'cdn_dp_resume' defined but not used [-Wunused-function] static int cdn_dp_resume(struct device *dev) ^ In file included from :0:0: /kisskb/src/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c: In function 'ifh_encode_bitfield': /kisskb/src/include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_418' declared with attribute error: Unsupported width, must be <= 40 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ /kisskb/src/include/linux/compiler_types.h:309:4: note: in definition of macro '__compiletime_assert' prefix ## suffix(); \ ^ /kisskb/src/include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ /kisskb/src/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c:28:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(width <= 40, "Unsupported width, must be <= 40"); ^ make[6]: *** [/kisskb/src/scripts/Makefile.build:271: drivers/net/ethernet/microchip/sparx5/sparx5_netdev.o] Error 1 make[5]: *** [/kisskb/src/scripts/Makefile.build:514: drivers/net/ethernet/microchip/sparx5] Error 2 make[4]: *** [/kisskb/src/scripts/Makefile.build:514: drivers/net/ethernet/microchip] Error 2 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:514: drivers/net/ethernet] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:514: drivers/net] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1841: drivers] Error 2 make: *** [Makefile:220: __sub-make] Error 2 Command 'make -s -j 24 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_xtensa-allmodconfig_xtensa # Build took: 0:17:23.381777