WARNING: externs should be avoided in .c files #63: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:252: +extern void usdt_2(void); WARNING: line length of 81 exceeds 80 columns #66: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:255: +static unsigned char nop1_nop5_combo[6] = { 0x90, 0x0f, 0x1f, 0x44, 0x00, 0x00 }; CHECK: No space is necessary after a cast #102: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:291: + skel->bss->expected_ip = (unsigned long) addr_1; WARNING: line length of 87 exceeds 80 columns #108: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:297: + skel->links.usdt_executed = bpf_program__attach_usdt(skel->progs.usdt_executed, WARNING: line length of 82 exceeds 80 columns #109: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:298: + 0 /*self*/, "/proc/self/exe", CHECK: Alignment should match open parenthesis #109: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:298: + skel->links.usdt_executed = bpf_program__attach_usdt(skel->progs.usdt_executed, + 0 /*self*/, "/proc/self/exe", WARNING: line length of 89 exceeds 80 columns #110: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:299: + "optimized_attach", "usdt_1", NULL); WARNING: line length of 82 exceeds 80 columns #111: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:300: + if (!ASSERT_OK_PTR(skel->links.usdt_executed, "bpf_program__attach_usdt")) CHECK: No space is necessary after a cast #124: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:313: + skel->bss->expected_ip = (unsigned long) addr_2 + 1; WARNING: line length of 87 exceeds 80 columns #130: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:319: + skel->links.usdt_executed = bpf_program__attach_usdt(skel->progs.usdt_executed, WARNING: line length of 82 exceeds 80 columns #131: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:320: + 0 /*self*/, "/proc/self/exe", CHECK: Alignment should match open parenthesis #131: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:320: + skel->links.usdt_executed = bpf_program__attach_usdt(skel->progs.usdt_executed, + 0 /*self*/, "/proc/self/exe", WARNING: line length of 89 exceeds 80 columns #132: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:321: + "optimized_attach", "usdt_2", NULL); WARNING: line length of 82 exceeds 80 columns #133: FILE: tools/testing/selftests/bpf/prog_tests/usdt.c:322: + if (!ASSERT_OK_PTR(skel->links.usdt_executed, "bpf_program__attach_usdt")) ERROR: Macros with complex values should be enclosed in parentheses #198: FILE: tools/testing/selftests/bpf/usdt_1.c:9: +#define USDT_NOP .byte 0x90 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. WARNING: Prefer __aligned(16) over __attribute__((aligned(16))) #201: FILE: tools/testing/selftests/bpf/usdt_1.c:12: +__attribute__((aligned(16))) WARNING: Prefer __aligned(16) over __attribute__((aligned(16))) #223: FILE: tools/testing/selftests/bpf/usdt_2.c:10: +__attribute__((aligned(16))) total: 1 errors, 12 warnings, 4 checks, 168 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 14a15d6ffd51 ("selftests/bpf: Add test for checking correct nop of optimized usdt") 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.