========== checkpatch - FAILED CHECK: architecture specific defines should be avoided #31: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:13: +#if defined(__x86_64__) || defined(__i386__) WARNING: line length of 88 exceeds 80 columns #42: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:24: + * For example, for an array of 'short' (signed 2-byte elements), the SIB spec would be: WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst #47: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:29: +static volatile short array[] = {-1, -2, -3, -4}; CHECK: spaces preferred around that '%' (ctx:BxO) #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) ^ CHECK: spaces preferred around that '%' (ctx:OxV) #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) ^ ERROR: space required after that ',' (ctx:VxO) #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) ^ CHECK: spaces preferred around that '%' (ctx:OxO) #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) ^ CHECK: spaces preferred around that '%' (ctx:OxV) #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) ^ ERROR: space required after that ',' (ctx:VxV) #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) ^ ERROR: Macros with complex values should be enclosed in parentheses #48: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:30: +#define USDT_SIB_ARG_SPEC -2@(%%rdx,%%rax,2) BUT SEE: do {} while (0) advice is over-stated in a few situations: The more obvious case is macros, like MODULE_PARM_DESC, invoked at file-scope, where C disallows code (it must be in functions). See $exceptions if you have one to add by name. More troublesome is declarative macros used at top of new scope, like DECLARE_PER_CPU. These might just compile with a do-while-0 wrapper, but would be incorrect. Most of these are handled by detecting struct,union,etc declaration primitives in $exceptions. Theres also macros called inside an if (block), which "return" an expression. These cannot do-while, and need a ({}) wrapper. Enjoy this qualification while we work to improve our heuristics. CHECK: architecture specific defines should be avoided #58: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:48: +#if defined(__x86_64__) || defined(__i386__) CHECK: architecture specific defines should be avoided #69: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:67: +#if defined(__x86_64__) || defined(__i386__) CHECK: Lines should not end with a '(' #74: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:72: + asm volatile( CHECK: architecture specific defines should be avoided #105: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:108: +#if defined(__x86_64__) || defined(__i386__) WARNING: line length of 93 exceeds 80 columns #108: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:111: + 0 /*self*/, "/proc/self/exe", CHECK: Alignment should match open parenthesis #108: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:111: + skel->links.usdt_sib = bpf_program__attach_usdt(skel->progs.usdt_sib, + 0 /*self*/, "/proc/self/exe", WARNING: line length of 91 exceeds 80 columns #109: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:112: + "test", "usdt_sib", &opts); CHECK: architecture specific defines should be avoided #129: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:207: +#if defined(__x86_64__) || defined(__i386__) CHECK: Please don't use multiple blank lines #150: FILE: tools/testing/selftests/bpf/progs/test_usdt.c:110: + total: 3 errors, 4 warnings, 12 checks, 146 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 4c1d70ee55be ("selftests/bpf: Enrich subtest_basic_usdt case in selftests to cover SIB handling logic") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE 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.