CHECK: Macro argument 'op' may be better as '(op)' to avoid precedence issues #132: FILE: include/linux/memcontrol.h:612: +#define BPF_MEMCG_CALL(memcg, op, default_val) ({ \ + typeof(default_val) __ret = (default_val); \ + struct memcg_bpf_ops *__ops; \ + int __idx; \ + \ + if (unlikely(READ_ONCE((memcg)->bpf_ops))) { \ + __idx = srcu_read_lock(&memcg_bpf_srcu); \ + __ops = READ_ONCE((memcg)->bpf_ops); \ + if (__ops && __ops->op) \ + __ret = __ops->op(memcg); \ + srcu_read_unlock(&memcg_bpf_srcu, __idx); \ + } \ + __ret; \ +}) CHECK: extern prototypes should be avoided in .h files #167: FILE: include/linux/memcontrol.h:647: +extern void memcontrol_bpf_online(struct mem_cgroup *memcg); CHECK: extern prototypes should be avoided in .h files #168: FILE: include/linux/memcontrol.h:648: +extern void memcontrol_bpf_offline(struct mem_cgroup *memcg); CHECK: Alignment should match open parenthesis #308: FILE: mm/bpf_memcontrol.c:253: +static int memcg_ops_btf_struct_access(struct bpf_verifier_log *log, + const struct bpf_reg_state *reg, WARNING: line length of 83 exceeds 80 columns #314: FILE: mm/bpf_memcontrol.c:259: +static bool memcg_ops_is_valid_access(int off, int size, enum bpf_access_type type, CHECK: Alignment should match open parenthesis #315: FILE: mm/bpf_memcontrol.c:260: +static bool memcg_ops_is_valid_access(int off, int size, enum bpf_access_type type, + const struct bpf_prog *prog, CHECK: Alignment should match open parenthesis #364: FILE: mm/bpf_memcontrol.c:309: +static int bpf_memcg_ops_check_member(const struct btf_type *t, + const struct btf_member *member, CHECK: Alignment should match open parenthesis #387: FILE: mm/bpf_memcontrol.c:332: +static int bpf_memcg_ops_init_member(const struct btf_type *t, + const struct btf_member *member, CHECK: Assignment operator '=' should be on the previous line #415: FILE: mm/bpf_memcontrol.c:360: + struct bpf_struct_ops_link *ops_link + = container_of(link, struct bpf_struct_ops_link, link); CHECK: Assignment operator '=' should be on the previous line #445: FILE: mm/bpf_memcontrol.c:390: + struct bpf_struct_ops_link *ops_link + = container_of(link, struct bpf_struct_ops_link, link); CHECK: braces {} should be used on all arms of this statement #514: FILE: mm/memcontrol.c:2298: + if (nr_pages) { [...] + penalty_jiffies += calculate_high_delay( [...] CHECK: Lines should not end with a '(' #515: FILE: mm/memcontrol.c:2299: + penalty_jiffies = calculate_high_delay( CHECK: Lines should not end with a '(' #520: FILE: mm/memcontrol.c:2302: + penalty_jiffies += calculate_high_delay( CHECK: Unbalanced braces around else statement #522: FILE: mm/memcontrol.c:2304: + } else total: 0 errors, 1 warnings, 13 checks, 505 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 30160c186f40 ("mm: memcontrol: Add BPF struct_ops for memory controller") 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. total: 0 errors, 1 warnings, 13 checks, 505 lines checked