WARNING: do not add new typedefs #198: FILE: tools/testing/selftests/bpf/libarena/selftests/selftest.c:25: +typedef struct libarena_asan selftest; CHECK: Lines should not end with a '(' #229: FILE: tools/testing/selftests/bpf/libarena/selftests/selftest.c:93: + ret = libarena_asan_init( WARNING: line length of 87 exceeds 80 columns #246: FILE: tools/testing/selftests/bpf/libarena/selftests/selftest.c:146: + /* Check if our BPF programs are ASAN-capable using strstr on the prog name. */ WARNING: line length of 81 exceeds 80 columns #251: FILE: tools/testing/selftests/bpf/libarena/selftests/selftest.c:150: + printf("=== %s %s===\n", "libarena selftests", is_asan ? "(asan) " : ""); WARNING: Improper SPDX comment style for 'tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h', please use '/*' instead #261: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:1: +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #261: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:1: +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause WARNING: Single statement macros should not use a do {} while (0) loop #268: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:8: +#define ASAN_MAP_STATE(addr) \ + do { \ + arena_stdout("%s:%d ASAN %lx -> (val: %x gran: %x set: [%s])", \ + __func__, __LINE__, addr, \ + asan_shadow_value((addr)), ASAN_GRANULE(addr), \ + asan_shadow_set((addr)) ? "yes" : "no"); \ + } while (0) WARNING: Macros with flow control statements should be avoided #280: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:20: +#define ASAN_VALIDATE_ADDR(cond, addr) \ + do { \ + asm volatile("" ::: "memory"); \ + if ((asan_violated != 0) != (cond)) { \ + arena_stdout("%s:%d ASAN asan_violated %lx", __func__, \ + __LINE__, (u64)asan_violated); \ + ASAN_MAP_STATE((addr)); \ + return -EINVAL; \ + } \ + asan_violated = 0; \ + } while (0) CHECK: Unnecessary parentheses around 'asan_violated != 0' #283: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:23: + if ((asan_violated != 0) != (cond)) { \ WARNING: Macros with flow control statements should be avoided #292: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:32: +#define ASAN_VALIDATE() \ + do { \ + if ((asan_violated)) { \ + arena_stdout("%s:%d Found ASAN violation at %lx", \ + __func__, __LINE__, asan_violated); \ + return -EINVAL; \ + } \ + } while (0) WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #302: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:42: + volatile u8 mem[59]; CHECK: Please don't use multiple blank lines #306: FILE: tools/testing/selftests/bpf/libarena/selftests/st_asan_common.h:46: + + total: 0 errors, 9 warnings, 3 checks, 240 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 44ac9f14e8f8 ("selftests/bpf: Add ASAN support for libarena selftests") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 9 warnings, 3 checks, 240 lines checked