# git rev-parse -q --verify 07a9d6cdcca83271b0ba04ec0d333cd9cd352a51^{commit} 07a9d6cdcca83271b0ba04ec0d333cd9cd352a51 already have revision, skipping fetch # git checkout -q -f -B kisskb 07a9d6cdcca83271b0ba04ec0d333cd9cd352a51 # git clean -qxdf # < git log -1 # commit 07a9d6cdcca83271b0ba04ec0d333cd9cd352a51 # Author: Gustavo A. R. Silva # Date: Wed Aug 7 11:42:29 2019 -0500 # # perf/x86/intel/uncore: Use struct_size() in kzalloc_node() # # One of the more common cases of allocation size calculations is finding # the size of a structure that has a zero-sized array at the end, along # with memory for some number of elements for that array. For example: # # struct intel_uncore_box { # ... # struct intel_uncore_extra_reg shared_regs[0]; # }; # # size = sizeof(struct intel_uncore_box) + count * sizeof(struct intel_uncore_extra_reg); # instance = kzalloc_node(size, GFP_KERNEL, node); # # Instead of leaving these open-coded and prone to type mistakes, we can # now use the new struct_size() helper: # # instance = kzalloc_node(struct_size(instance, shared_regs, count), GFP_KERNEL, # node); # # Notice that, in this case, variable size is not necessary, hence it # is removed. # # This code was detected with the help of Coccinelle. # # Signed-off-by: Gustavo A. R. Silva # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux-ld --version # < git log --format=%s --max-count=1 07a9d6cdcca83271b0ba04ec0d333cd9cd352a51 # < make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_cavium_octeon_defconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- cavium_octeon_defconfig # make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_cavium_octeon_defconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- :1511:2: warning: #warning syscall clone3 not implemented [-Wcpp] :1511:2: warning: #warning syscall clone3 not implemented [-Wcpp] :1511:2: warning: #warning syscall clone3 not implemented [-Wcpp] In file included from /kisskb/src/arch/mips/cavium-octeon/octeon-usb.c:12: /kisskb/src/arch/mips/cavium-octeon/octeon-usb.c: In function 'dwc3_octeon_clocks_start': /kisskb/src/include/linux/device.h:1499:2: error: this statement may fall through [-Werror=implicit-fallthrough=] _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/mips/cavium-octeon/octeon-usb.c:399:3: note: in expansion of macro 'dev_err' dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n", ^~~~~~~ /kisskb/src/arch/mips/cavium-octeon/octeon-usb.c:401:2: note: here case 100000000: ^~~~ cc1: all warnings being treated as errors make[3]: *** [/kisskb/src/scripts/Makefile.build:273: arch/mips/cavium-octeon/octeon-usb.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/scripts/Makefile.build:490: arch/mips/cavium-octeon] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1079: arch/mips] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:179: sub-make] Error 2 Command 'make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_cavium_octeon_defconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/gustavoars_cavium_octeon_defconfig_mips-gcc8 # Build took: 0:00:47.385833