WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #40: new file mode 100644 WARNING: line length of 93 exceeds 80 columns #94: FILE: tools/testing/selftests/bpf/prog_tests/string_kfuncs.c:50: + ASSERT_EQ(topts.retval, -E2BIG, "reading too long string fails with -E2BIG"); WARNING: please, no spaces at the start of a line #130: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:17: + defined(__TARGET_ARCH_powerpc) || defined(__TARGET_ARCH_x86)$ WARNING: line length of 108 exceeds 80 columns #143: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:30: +SEC("syscall") __retval(USER_PTR_ERR) int test_strcmp_null1(void *ctx) { return bpf_strcmp(NULL, "hello"); } WARNING: line length of 108 exceeds 80 columns #144: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:31: +SEC("syscall") __retval(USER_PTR_ERR)int test_strcmp_null2(void *ctx) { return bpf_strcmp("hello", NULL); } WARNING: line length of 103 exceeds 80 columns #145: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:32: +SEC("syscall") __retval(USER_PTR_ERR)int test_strchr_null(void *ctx) { return bpf_strchr(NULL, 'a'); } WARNING: line length of 109 exceeds 80 columns #146: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:33: +SEC("syscall") __retval(USER_PTR_ERR)int test_strchrnul_null(void *ctx) { return bpf_strchrnul(NULL, 'a'); } WARNING: line length of 108 exceeds 80 columns #147: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:34: +SEC("syscall") __retval(USER_PTR_ERR)int test_strnchr_null(void *ctx) { return bpf_strnchr(NULL, 1, 'a'); } WARNING: line length of 105 exceeds 80 columns #148: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:35: +SEC("syscall") __retval(USER_PTR_ERR)int test_strrchr_null(void *ctx) { return bpf_strrchr(NULL, 'a'); } WARNING: line length of 98 exceeds 80 columns #149: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:36: +SEC("syscall") __retval(USER_PTR_ERR)int test_strlen_null(void *ctx) { return bpf_strlen(NULL); } WARNING: line length of 103 exceeds 80 columns #150: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:37: +SEC("syscall") __retval(USER_PTR_ERR)int test_strnlen_null(void *ctx) { return bpf_strnlen(NULL, 1); } WARNING: line length of 108 exceeds 80 columns #151: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:38: +SEC("syscall") __retval(USER_PTR_ERR)int test_strspn_null1(void *ctx) { return bpf_strspn(NULL, "hello"); } WARNING: line length of 108 exceeds 80 columns #152: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:39: +SEC("syscall") __retval(USER_PTR_ERR)int test_strspn_null2(void *ctx) { return bpf_strspn("hello", NULL); } WARNING: line length of 110 exceeds 80 columns #153: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:40: +SEC("syscall") __retval(USER_PTR_ERR)int test_strcspn_null1(void *ctx) { return bpf_strcspn(NULL, "hello"); } WARNING: line length of 110 exceeds 80 columns #154: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:41: +SEC("syscall") __retval(USER_PTR_ERR)int test_strcspn_null2(void *ctx) { return bpf_strcspn("hello", NULL); } WARNING: line length of 108 exceeds 80 columns #155: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:42: +SEC("syscall") __retval(USER_PTR_ERR)int test_strstr_null1(void *ctx) { return bpf_strstr(NULL, "hello"); } WARNING: line length of 108 exceeds 80 columns #156: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:43: +SEC("syscall") __retval(USER_PTR_ERR)int test_strstr_null2(void *ctx) { return bpf_strstr("hello", NULL); } WARNING: line length of 113 exceeds 80 columns #157: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:44: +SEC("syscall") __retval(USER_PTR_ERR)int test_strnstr_null1(void *ctx) { return bpf_strnstr(NULL, "hello", 1); } WARNING: line length of 113 exceeds 80 columns #158: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:45: +SEC("syscall") __retval(USER_PTR_ERR)int test_strnstr_null2(void *ctx) { return bpf_strnstr("hello", NULL, 1); } WARNING: line length of 116 exceeds 80 columns #161: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:48: +SEC("syscall") __retval(USER_PTR_ERR) int test_strcmp_user_ptr1(void *ctx) { return bpf_strcmp(user_ptr, "hello"); } WARNING: line length of 116 exceeds 80 columns #162: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:49: +SEC("syscall") __retval(USER_PTR_ERR) int test_strcmp_user_ptr2(void *ctx) { return bpf_strcmp("hello", user_ptr); } WARNING: line length of 111 exceeds 80 columns #163: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:50: +SEC("syscall") __retval(USER_PTR_ERR) int test_strchr_user_ptr(void *ctx) { return bpf_strchr(user_ptr, 'a'); } WARNING: line length of 117 exceeds 80 columns #164: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:51: +SEC("syscall") __retval(USER_PTR_ERR) int test_strchrnul_user_ptr(void *ctx) { return bpf_strchrnul(user_ptr, 'a'); } WARNING: line length of 116 exceeds 80 columns #165: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:52: +SEC("syscall") __retval(USER_PTR_ERR) int test_strnchr_user_ptr(void *ctx) { return bpf_strnchr(user_ptr, 1, 'a'); } WARNING: line length of 113 exceeds 80 columns #166: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:53: +SEC("syscall") __retval(USER_PTR_ERR) int test_strrchr_user_ptr(void *ctx) { return bpf_strrchr(user_ptr, 'a'); } WARNING: line length of 106 exceeds 80 columns #167: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:54: +SEC("syscall") __retval(USER_PTR_ERR) int test_strlen_user_ptr(void *ctx) { return bpf_strlen(user_ptr); } WARNING: line length of 111 exceeds 80 columns #168: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:55: +SEC("syscall") __retval(USER_PTR_ERR) int test_strnlen_user_ptr(void *ctx) { return bpf_strnlen(user_ptr, 1); } WARNING: line length of 116 exceeds 80 columns #169: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:56: +SEC("syscall") __retval(USER_PTR_ERR) int test_strspn_user_ptr1(void *ctx) { return bpf_strspn(user_ptr, "hello"); } WARNING: line length of 116 exceeds 80 columns #170: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:57: +SEC("syscall") __retval(USER_PTR_ERR) int test_strspn_user_ptr2(void *ctx) { return bpf_strspn("hello", user_ptr); } WARNING: line length of 118 exceeds 80 columns #171: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:58: +SEC("syscall") __retval(USER_PTR_ERR) int test_strcspn_user_ptr1(void *ctx) { return bpf_strcspn(user_ptr, "hello"); } WARNING: line length of 118 exceeds 80 columns #172: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:59: +SEC("syscall") __retval(USER_PTR_ERR) int test_strcspn_user_ptr2(void *ctx) { return bpf_strcspn("hello", user_ptr); } WARNING: line length of 116 exceeds 80 columns #173: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:60: +SEC("syscall") __retval(USER_PTR_ERR) int test_strstr_user_ptr1(void *ctx) { return bpf_strstr(user_ptr, "hello"); } WARNING: line length of 116 exceeds 80 columns #174: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:61: +SEC("syscall") __retval(USER_PTR_ERR) int test_strstr_user_ptr2(void *ctx) { return bpf_strstr("hello", user_ptr); } WARNING: line length of 121 exceeds 80 columns #175: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:62: +SEC("syscall") __retval(USER_PTR_ERR) int test_strnstr_user_ptr1(void *ctx) { return bpf_strnstr(user_ptr, "hello", 1); } WARNING: line length of 121 exceeds 80 columns #176: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:63: +SEC("syscall") __retval(USER_PTR_ERR) int test_strnstr_user_ptr2(void *ctx) { return bpf_strnstr("hello", user_ptr, 1); } WARNING: line length of 120 exceeds 80 columns #181: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:68: +SEC("syscall") __retval(-EFAULT) int test_strcmp_pagefault1(void *ctx) { return bpf_strcmp(invalid_kern_ptr, "hello"); } WARNING: line length of 120 exceeds 80 columns #182: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:69: +SEC("syscall") __retval(-EFAULT) int test_strcmp_pagefault2(void *ctx) { return bpf_strcmp("hello", invalid_kern_ptr); } WARNING: line length of 115 exceeds 80 columns #183: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:70: +SEC("syscall") __retval(-EFAULT) int test_strchr_pagefault(void *ctx) { return bpf_strchr(invalid_kern_ptr, 'a'); } WARNING: line length of 121 exceeds 80 columns #184: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:71: +SEC("syscall") __retval(-EFAULT) int test_strchrnul_pagefault(void *ctx) { return bpf_strchrnul(invalid_kern_ptr, 'a'); } WARNING: line length of 120 exceeds 80 columns #185: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:72: +SEC("syscall") __retval(-EFAULT) int test_strnchr_pagefault(void *ctx) { return bpf_strnchr(invalid_kern_ptr, 1, 'a'); } WARNING: line length of 117 exceeds 80 columns #186: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:73: +SEC("syscall") __retval(-EFAULT) int test_strrchr_pagefault(void *ctx) { return bpf_strrchr(invalid_kern_ptr, 'a'); } WARNING: line length of 110 exceeds 80 columns #187: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:74: +SEC("syscall") __retval(-EFAULT) int test_strlen_pagefault(void *ctx) { return bpf_strlen(invalid_kern_ptr); } WARNING: line length of 115 exceeds 80 columns #188: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:75: +SEC("syscall") __retval(-EFAULT) int test_strnlen_pagefault(void *ctx) { return bpf_strnlen(invalid_kern_ptr, 1); } WARNING: line length of 120 exceeds 80 columns #189: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:76: +SEC("syscall") __retval(-EFAULT) int test_strspn_pagefault1(void *ctx) { return bpf_strspn(invalid_kern_ptr, "hello"); } WARNING: line length of 120 exceeds 80 columns #190: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:77: +SEC("syscall") __retval(-EFAULT) int test_strspn_pagefault2(void *ctx) { return bpf_strspn("hello", invalid_kern_ptr); } WARNING: line length of 122 exceeds 80 columns #191: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:78: +SEC("syscall") __retval(-EFAULT) int test_strcspn_pagefault1(void *ctx) { return bpf_strcspn(invalid_kern_ptr, "hello"); } WARNING: line length of 122 exceeds 80 columns #192: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:79: +SEC("syscall") __retval(-EFAULT) int test_strcspn_pagefault2(void *ctx) { return bpf_strcspn("hello", invalid_kern_ptr); } WARNING: line length of 120 exceeds 80 columns #193: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:80: +SEC("syscall") __retval(-EFAULT) int test_strstr_pagefault1(void *ctx) { return bpf_strstr(invalid_kern_ptr, "hello"); } WARNING: line length of 120 exceeds 80 columns #194: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:81: +SEC("syscall") __retval(-EFAULT) int test_strstr_pagefault2(void *ctx) { return bpf_strstr("hello", invalid_kern_ptr); } WARNING: line length of 125 exceeds 80 columns #195: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:82: +SEC("syscall") __retval(-EFAULT) int test_strnstr_pagefault1(void *ctx) { return bpf_strnstr(invalid_kern_ptr, "hello", 1); } WARNING: line length of 125 exceeds 80 columns #196: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure1.c:83: +SEC("syscall") __retval(-EFAULT) int test_strnstr_pagefault2(void *ctx) { return bpf_strnstr("hello", invalid_kern_ptr, 1); } WARNING: line length of 93 exceeds 80 columns #213: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:9: +SEC("syscall") int test_strcmp_too_long(void *ctx) { return bpf_strcmp(long_str, long_str); } WARNING: line length of 88 exceeds 80 columns #214: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:10: +SEC("syscall") int test_strchr_too_long(void *ctx) { return bpf_strchr(long_str, 'b'); } WARNING: line length of 94 exceeds 80 columns #215: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:11: +SEC("syscall") int test_strchrnul_too_long(void *ctx) { return bpf_strchrnul(long_str, 'b'); } WARNING: line length of 108 exceeds 80 columns #216: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:12: +SEC("syscall") int test_strnchr_too_long(void *ctx) { return bpf_strnchr(long_str, sizeof(long_str), 'b'); } WARNING: line length of 90 exceeds 80 columns #217: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:13: +SEC("syscall") int test_strrchr_too_long(void *ctx) { return bpf_strrchr(long_str, 'b'); } WARNING: line length of 83 exceeds 80 columns #218: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:14: +SEC("syscall") int test_strlen_too_long(void *ctx) { return bpf_strlen(long_str); } WARNING: line length of 103 exceeds 80 columns #219: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:15: +SEC("syscall") int test_strnlen_too_long(void *ctx) { return bpf_strnlen(long_str, sizeof(long_str)); } WARNING: line length of 88 exceeds 80 columns #220: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:16: +SEC("syscall") int test_strspn_too_long(void *ctx) { return bpf_strspn(long_str, "a"); } WARNING: line length of 90 exceeds 80 columns #221: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:17: +SEC("syscall") int test_strcspn_too_long(void *ctx) { return bpf_strcspn(long_str, "b"); } WARNING: line length of 92 exceeds 80 columns #222: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:18: +SEC("syscall") int test_strstr_too_long(void *ctx) { return bpf_strstr(long_str, "hello"); } WARNING: line length of 112 exceeds 80 columns #223: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_failure2.c:19: +SEC("syscall") int test_strnstr_too_long(void *ctx) { return bpf_strnstr(long_str, "hello", sizeof(long_str)); } ERROR: Macros with complex values should be enclosed in parentheses #240: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:9: +#define __test(retval) SEC("syscall") __success __retval(retval) 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: line length of 82 exceeds 80 columns #243: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:12: +__test(0) int test_strcmp_eq(void *ctx) { return bpf_strcmp(str, "hello world"); } WARNING: line length of 81 exceeds 80 columns #248: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:17: +__test(1) int test_strchrnul_found(void *ctx) { return bpf_strchrnul(str, 'e'); } WARNING: line length of 85 exceeds 80 columns #249: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:18: +__test(11) int test_strchrnul_notfound(void *ctx) { return bpf_strchrnul(str, 'x'); } WARNING: line length of 82 exceeds 80 columns #251: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:20: +__test(11) int test_strnchr_null(void *ctx) { return bpf_strnchr(str, 12, '\0'); } WARNING: line length of 84 exceeds 80 columns #252: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:21: +__test(-1) int test_strnchr_notfound(void *ctx) { return bpf_strnchr(str, 5, 'w'); } WARNING: line length of 81 exceeds 80 columns #254: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:23: +__test(-1) int test_strrchr_notfound(void *ctx) { return bpf_strrchr(str, 'x'); } WARNING: line length of 84 exceeds 80 columns #262: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:31: +__test(0) int test_strnstr_found(void *ctx) { return bpf_strnstr(str, "hello", 6); } WARNING: line length of 86 exceeds 80 columns #263: FILE: tools/testing/selftests/bpf/progs/string_kfuncs_success.c:32: +__test(-1) int test_strnstr_notfound(void *ctx) { return bpf_strnstr(str, "hi", 10); } total: 1 errors, 70 warnings, 0 checks, 204 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 e3df3199e9c7 ("selftests/bpf: Add tests for string kfuncs") 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.