# git rev-parse -q --verify 736116436e5b99b46e1a49c17cae6f6ee0a30e84^{commit} # git fetch -q -n -f https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/kspp # git rev-parse -q --verify 736116436e5b99b46e1a49c17cae6f6ee0a30e84^{commit} 736116436e5b99b46e1a49c17cae6f6ee0a30e84 # git checkout -q -f -B kisskb 736116436e5b99b46e1a49c17cae6f6ee0a30e84 # git clean -qxdf # < git log -1 # commit 736116436e5b99b46e1a49c17cae6f6ee0a30e84 # Author: Gustavo A. R. Silva # Date: Wed Sep 2 23:25:55 2020 -0500 # # include: jhash/signal: Fix fall-through warnings for Clang # # In preparation to enable -Wimplicit-fallthrough for Clang, explicitly # add break statements instead of letting the code fall through to the # next case. # # This patch adds four break statements that, together, fix almost 80,000 # warnings when building Linux 5.9-rc3 with Clang 12.0.0 and this[1] change # reverted. Notice that in order to enable -Wimplicit-fallthrough for Clang, # such change[1] is meant to be reverted at some point. So, this patch helps # to move in that direction. # # Something important to mention is that there is currently a discrepancy # between GCC and Clang when dealing with switch fall-through to empty case # statements or to cases that only contain a break/continue/return # statement[2][3][4]. # # Now that the -Wimplicit-fallthrough option has been globally enabled[5], # any compiler should really warn on missing either a fallthrough annotation # or any of the other case-terminating statements (break/continue/return/ # goto) when falling through to the next case statement. Making exceptions # to this introduces variation in case handling which may continue to lead # to bugs, misunderstandings, and a general lack of robustness. The point # of enabling options like -Wimplicit-fallthrough is to prevent human error # and aid developers in spotting bugs before their code is even built/ # submitted/committed, therefore eliminating classes of bugs. So, min order # to really accomplish this, we should, and can, move in the direction of # addressing any error-prone scenarios and get rid of the unintentional # fallthrough bug-class in the kernel, entirely, even if there is some minor # redundancy. Better to have explicit case-ending statements than continue to # have exceptions where one must guess as to the right result. The compiler # will eliminate any actual redundancy. # # [1] commit e2079e93f562c ("kbuild: Do not enable -Wimplicit-fallthrough for clang for now") # [2] https://github.com/ClangBuiltLinux/linux/issues/636 # [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432 # [4] https://godbolt.org/z/xgkvIh # [5] commit a035d552a93b ("Makefile: Globally enable fall-through warning") # # Co-developed-by: Kees Cook # Signed-off-by: Kees Cook # Signed-off-by: Gustavo A. R. Silva # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 736116436e5b99b46e1a49c17cae6f6ee0a30e84 # < make -s -j 8 ARCH=powerpc O=/kisskb/build/gustavoars_mpc85xx_defconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_defconfig # < make -s -j 8 ARCH=powerpc O=/kisskb/build/gustavoars_mpc85xx_defconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 8 ARCH=powerpc O=/kisskb/build/gustavoars_mpc85xx_defconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 8 ARCH=powerpc O=/kisskb/build/gustavoars_mpc85xx_defconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:12, from /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15: /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 22 | #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) | ^ /kisskb/src/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely' 78 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: note: in expansion of macro 'IS_ERR_VALUE' 139 | if (IS_ERR_VALUE(fep->ring_mem_addr)) | ^~~~~~~~~~~~ cc1: fatal error: opening output file arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory compilation terminated. make[2]: *** [scripts/Makefile.lib:326: arch/powerpc/boot/dts/fsl/mpc8540ads.dtb] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [arch/powerpc/Makefile:295: zImage] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:185: __sub-make] Error 2 Command 'make -s -j 8 ARCH=powerpc O=/kisskb/build/gustavoars_mpc85xx_defconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/gustavoars_mpc85xx_defconfig_powerpc-gcc9 # Build took: 0:03:53.214223