WARNING: Co-developed-by and Signed-off-by: name/email do not match #21: Co-developed-by: Eduard Zingerman Signed-off-by: pengdonglin WARNING: line length of 97 exceeds 80 columns #138: FILE: tools/lib/bpf/btf.c:5828: +static struct btf_permute *btf_permute_new(struct btf *btf, const struct btf_permute_opts *opts); WARNING: Block comments use a trailing */ on a separate line #196: FILE: tools/lib/bpf/btf.c:5886: + * type ID, its length equals to the above ids */ WARNING: line length of 96 exceeds 80 columns #200: FILE: tools/lib/bpf/btf.c:5890: +static struct btf_permute *btf_permute_new(struct btf *btf, const struct btf_permute_opts *opts) ERROR: space prohibited before that ':' (ctx:WxV) #382: FILE: tools/lib/bpf/btf.h:287: + size_t :0; ^ CHECK: Please use a blank line after function/struct/union/enum declarations #384: FILE: tools/lib/bpf/btf.h:289: +}; +#define btf_permute_opts__last_field ids WARNING: line length of 82 exceeds 80 columns #386: FILE: tools/lib/bpf/btf.h:291: +LIBBPF_API int btf__permute(struct btf *btf, const struct btf_permute_opts *opts); WARNING: line length of 81 exceeds 80 columns #406: FILE: tools/lib/bpf/btf_sort.c:10: +#define btf_type_by_id (struct btf_type *)btf_type_by_id ERROR: Macros with complex values should be enclosed in parentheses #406: FILE: tools/lib/bpf/btf_sort.c:10: +#define btf_type_by_id (struct btf_type *)btf_type_by_id 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 81 exceeds 80 columns #437: FILE: tools/lib/bpf/btf_sort.c:41: +static int btf_compare_type_kinds_names(const void *a, const void *b, void *priv) WARNING: line length of 81 exceeds 80 columns #467: FILE: tools/lib/bpf/btf_sort.c:71: +static __s32 notrace __btf_find_by_name_kind(const struct btf *btf, int start_id, CHECK: Alignment should match open parenthesis #468: FILE: tools/lib/bpf/btf_sort.c:72: +static __s32 notrace __btf_find_by_name_kind(const struct btf *btf, int start_id, + const char *type_name, __u32 kind) WARNING: line length of 88 exceeds 80 columns #478: FILE: tools/lib/bpf/btf_sort.c:82: + err = __btf_find_by_name_kind(btf->base_btf, start_id, type_name, kind); ERROR: space required before the open parenthesis '(' #492: FILE: tools/lib/bpf/btf_sort.c:96: + while(start <= end) { WARNING: line length of 86 exceeds 80 columns #496: FILE: tools/lib/bpf/btf_sort.c:100: + ret = cmp_btf_kind_name(BTF_INFO_KIND(t->info), tname, CHECK: braces {} should be used on all arms of this statement #498: FILE: tools/lib/bpf/btf_sort.c:102: + if (ret < 0) [...] + else { [...] CHECK: Unbalanced braces around else statement #500: FILE: tools/lib/bpf/btf_sort.c:104: + else { CHECK: Alignment should match open parenthesis #532: FILE: tools/lib/bpf/btf_sort.c:136: +static __s32 notrace _btf_find_by_name_kind(const struct btf *btf, int start_id, + const char *type_name, __u32 kind) WARNING: line length of 83 exceeds 80 columns #537: FILE: tools/lib/bpf/btf_sort.c:141: + return libbpf_err(__btf_find_by_name_kind(btf, start_id, type_name, kind)); WARNING: line length of 108 exceeds 80 columns #583: FILE: tools/lib/bpf/btf_sort.h:7: +static __s32 _btf_find_by_name_kind(const struct btf *btf, int start_id, const char *type_name, __u32 kind); WARNING: line length of 82 exceeds 80 columns #584: FILE: tools/lib/bpf/btf_sort.h:8: +static int btf_compare_type_kinds_names(const void *a, const void *b, void *priv); total: 3 errors, 13 warnings, 5 checks, 539 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 63b03b69794d ("btf: implement BTF type sorting for accelerated lookups") 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.