# git rev-parse -q --verify a33082bd198c21dada3f05913a116538b5d758b6^{commit} a33082bd198c21dada3f05913a116538b5d758b6 already have revision, skipping fetch # git checkout -q -f -B kisskb a33082bd198c21dada3f05913a116538b5d758b6 # git clean -qxdf # < git log -1 # commit a33082bd198c21dada3f05913a116538b5d758b6 # Author: Len Baker # Date: Sun Sep 12 15:10:57 2021 +0200 # # nfp: Prefer struct_size over open coded arithmetic # # As noted in the "Deprecated Interfaces, Language Features, Attributes, # and Conventions" documentation [1], size calculations (especially # multiplication) should not be performed in memory allocator (or similar) # function arguments due to the risk of them overflowing. This could lead # to values wrapping around and a smaller allocation being made than the # caller was expecting. Using those allocations could lead to linear # overflows of heap memory and other misbehaviors. # # So, use the struct_size() helper to do the arithmetic instead of the # argument "size + count * size" in the kzalloc() function. # # [1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments # # Signed-off-by: Len Baker # Reviewed-by: Gustavo A. R. Silva # Reviewed-by: Simon Horman # Signed-off-by: Gustavo A. R. Silva # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-ld --version # < git log --format=%s --max-count=1 a33082bd198c21dada3f05913a116538b5d758b6 # < make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_mips-allmodconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # Added to kconfig CONFIG_MIPS_CPS_NS16550_BASE=0x1b0003f8 # Added to kconfig CONFIG_MIPS_CPS_NS16550_SHIFT=0 # Added to kconfig # < make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_mips-allmodconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- help # make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_mips-allmodconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- olddefconfig .config:13233:warning: override: reassigning to symbol MIPS_CPS_NS16550_SHIFT # make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_mips-allmodconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- /kisskb/src/arch/mips/boot/dts/img/boston.dts:128.19-178.5: Warning (pci_device_reg): /pci@14000000/pci2_root@0,0,0: PCI unit address format error, expected "0,0" In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:35, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/latent_entropy_plugin.c:78: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ^ /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:41, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/latent_entropy_plugin.c:78: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/mips/mips.h:2913:20: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf (STREAM, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:56, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/latent_entropy_plugin.c:78: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:35, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/structleak_plugin.c:32: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ^ /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:35, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/sancov_plugin.c:22: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ^ /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:41, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/structleak_plugin.c:32: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/mips/mips.h:2913:20: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf (STREAM, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:41, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/sancov_plugin.c:22: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/mips/mips.h:2913:20: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf (STREAM, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:56, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/structleak_plugin.c:32: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:56, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/sancov_plugin.c:22: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:35, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/randomize_layout_plugin.c:19: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ^ /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:41, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/randomize_layout_plugin.c:19: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/config/mips/mips.h:2913:20: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf (STREAM, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) ^ In file included from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/tm.h:56, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/gcc-plugin.h:31, from /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/plugin.h:23, from /kisskb/src/scripts/gcc-plugins/gcc-common.h:9, from /kisskb/src/scripts/gcc-plugins/randomize_layout_plugin.c:19: /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/5.4.0/plugin/include/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ cc1plus: warning: unrecognized command line option '-Wno-format-diag' cc1plus: warning: unrecognized command line option '-Wno-format-diag' cc1plus: warning: unrecognized command line option '-Wno-format-diag' cc1plus: warning: unrecognized command line option '-Wno-format-diag' In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:28:0, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/bcm1480_scd.h:261:0: error: "M_SPC_CFG_CLEAR" redefined [-Werror] #define M_SPC_CFG_CLEAR M_BCM1480_SPC_CFG_CLEAR ^ In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:27:0, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/sb1250_scd.h:392:0: note: this is the location of the previous definition #define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) ^ In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:28:0, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/bcm1480_scd.h:262:0: error: "M_SPC_CFG_ENABLE" redefined [-Werror] #define M_SPC_CFG_ENABLE M_BCM1480_SPC_CFG_ENABLE ^ In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:27:0, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/sb1250_scd.h:393:0: note: this is the location of the previous definition #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) ^ cc1: all warnings being treated as errors make[3]: *** [/kisskb/src/scripts/Makefile.build:277: drivers/watchdog/sb_wdog.o] Error 1 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/watchdog] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1874: drivers] Error 2 make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 32 ARCH=mips O=/kisskb/build/gustavoars_mips-allmodconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/gustavoars_mips-allmodconfig_mipsel # Build took: 0:20:02.255210