WARNING: Co-developed-by and Signed-off-by: name/email do not match #23: Co-developed-by: Eduard Zingerman Signed-off-by: pengdonglin ERROR: "foo* bar" should be "foo *bar" #53: FILE: include/linux/btf.h:227: +struct btf* btf_base_btf(const struct btf *btf); WARNING: line length of 85 exceeds 80 columns #62: FILE: include/linux/btf.h:602: +s32 find_btf_by_name_kind(const struct btf *btf, int start_id, const char *type_name, WARNING: line length of 88 exceeds 80 columns #72: FILE: include/linux/btf.h:693: +static inline int btf_compare_type_kinds_names(const void *a, const void *b, void *priv) CHECK: Please use a blank line after function/struct/union/enum declarations #72: FILE: include/linux/btf.h:693: } +static inline int btf_compare_type_kinds_names(const void *a, const void *b, void *priv) WARNING: line length of 99 exceeds 80 columns #76: FILE: include/linux/btf.h:697: +static inline s32 find_btf_by_name_kind(const struct btf *btf, int start_id, const char *type_name, CHECK: Please use a blank line after function/struct/union/enum declarations #76: FILE: include/linux/btf.h:697: +} +static inline s32 find_btf_by_name_kind(const struct btf *btf, int start_id, const char *type_name, CHECK: Alignment should match open parenthesis #77: FILE: include/linux/btf.h:698: +static inline s32 find_btf_by_name_kind(const struct btf *btf, int start_id, const char *type_name, + u32 kind) CHECK: Please use a blank line after function/struct/union/enum declarations #81: FILE: include/linux/btf.h:702: +} +static inline void btf_check_sorted(struct btf *btf, int start_id); WARNING: line length of 82 exceeds 80 columns #331: FILE: tools/lib/bpf/btf.c:5307: + for (j = 0, i = 0, id = d->btf->start_id; i < d->btf->nr_types; i++, id++) WARNING: line length of 95 exceeds 80 columns #410: FILE: tools/lib/bpf/btf.c:5386: + d->btf->raw_size = d->btf->hdr->hdr_len + d->btf->hdr->type_len + d->btf->hdr->str_len; WARNING: line length of 81 exceeds 80 columns #461: FILE: tools/lib/bpf/btf_sort.c:12: +#define btf_type_by_id (struct btf_type *)btf_type_by_id ERROR: Macros with complex values should be enclosed in parentheses #461: FILE: tools/lib/bpf/btf_sort.c:12: +#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. CHECK: Alignment should match open parenthesis #519: FILE: tools/lib/bpf/btf_sort.c:70: +__s32 find_btf_by_name_kind(const struct btf *btf, int start_id, + const char *type_name, __u32 kind) ERROR: space required before the open parenthesis '(' #537: FILE: tools/lib/bpf/btf_sort.c:88: + while(start <= end) { WARNING: line length of 86 exceeds 80 columns #541: FILE: tools/lib/bpf/btf_sort.c:92: + ret = cmp_btf_kind_name(BTF_INFO_KIND(t->info), tname, WARNING: line length of 100 exceeds 80 columns #618: FILE: tools/lib/bpf/libbpf_internal.h:252: +__s32 find_btf_by_name_kind(const struct btf *btf, int start_id, const char *type_name, __u32 kind); total: 3 errors, 9 warnings, 5 checks, 525 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 51e35ff99c80 ("btf: sort BTF types by kind and name to enable binary search") 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.