# 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/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux-ld --version # < git log --format=%s --max-count=1 a33082bd198c21dada3f05913a116538b5d758b6 # < make -s -j 48 ARCH=m68k O=/kisskb/build/gustavoars_m68k-allmodconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-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 48 ARCH=m68k O=/kisskb/build/gustavoars_m68k-allmodconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- help # make -s -j 48 ARCH=m68k O=/kisskb/build/gustavoars_m68k-allmodconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- olddefconfig # make -s -j 48 ARCH=m68k O=/kisskb/build/gustavoars_m68k-allmodconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- /kisskb/src/arch/m68k/mvme147/config.c: In function 'mvme147_hwclk': /kisskb/src/arch/m68k/mvme147/config.c:174:2: error: #warning check me! [-Werror=cpp] #warning check me! ^~~~~~~ cc1: all warnings being treated as errors make[3]: *** [/kisskb/src/scripts/Makefile.build:277: arch/m68k/mvme147/config.o] Error 1 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: arch/m68k/mvme147] Error 2 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/arch/m68k/mvme16x/config.c: In function 'mvme16x_hwclk': /kisskb/src/arch/m68k/mvme16x/config.c:439:2: error: #warning check me! [-Werror=cpp] #warning check me! ^~~~~~~ cc1: all warnings being treated as errors make[3]: *** [/kisskb/src/scripts/Makefile.build:277: arch/m68k/mvme16x/config.o] Error 1 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: arch/m68k/mvme16x] Error 2 make[1]: *** [/kisskb/src/Makefile:1874: arch/m68k] Error 2 make[1]: *** Waiting for unfinished jobs.... In file included from /kisskb/src/arch/m68k/include/asm/io_mm.h:25, from /kisskb/src/arch/m68k/include/asm/io.h:8, from /kisskb/src/include/linux/io.h:13, from /kisskb/src/drivers/misc/altera-stapl/altera-lpt.c:12: /kisskb/src/drivers/misc/altera-stapl/altera-lpt.c: In function 'byteblaster_write': /kisskb/src/arch/m68k/include/asm/raw_io.h:30:32: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] #define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) ^ /kisskb/src/arch/m68k/include/asm/io_mm.h:354:72: note: in expansion of macro 'out_8' #define outb(val, port) ((port) < 1024 ? isa_rom_outb((val), (port)) : out_8((port), (val))) ^~~~~ /kisskb/src/drivers/misc/altera-stapl/altera-lpt.c:20:2: note: in expansion of macro 'outb' outb((u8)data, (u16)(port + 0x378)); ^~~~ /kisskb/src/drivers/misc/altera-stapl/altera-lpt.c: In function 'byteblaster_read': /kisskb/src/arch/m68k/include/asm/raw_io.h:20:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) ^ /kisskb/src/arch/m68k/include/asm/io_mm.h:347:56: note: in expansion of macro 'in_8' #define inb(port) ((port) < 1024 ? isa_rom_inb(port) : in_8(port)) ^~~~ /kisskb/src/drivers/misc/altera-stapl/altera-lpt.c:26:9: note: in expansion of macro 'inb' data = inb((u16)(port + 0x378)); ^~~ cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:277: drivers/misc/altera-stapl/altera-lpt.o] Error 1 make[3]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/misc/altera-stapl] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/misc] Error 2 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/drivers/gpu/drm/rockchip/cdn-dp-core.c:1126:12: error: 'cdn_dp_resume' defined but not used [-Werror=unused-function] static int cdn_dp_resume(struct device *dev) ^~~~~~~~~~~~~ cc1: all warnings being treated as errors make[5]: *** [/kisskb/src/scripts/Makefile.build:277: drivers/gpu/drm/rockchip/cdn-dp-core.o] Error 1 make[4]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/gpu/drm/rockchip] Error 2 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/gpu/drm] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/gpu] Error 2 make[1]: *** [/kisskb/src/Makefile:1874: drivers] Error 2 make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 48 ARCH=m68k O=/kisskb/build/gustavoars_m68k-allmodconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/m68k-linux/bin/m68k-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/gustavoars_m68k-allmodconfig_m68k-gcc8 # Build took: 0:06:18.600922