CHECK: Macro argument 'op' may be better as '(op)' to avoid precedence issues #118: FILE: include/linux/memcontrol.h:605: +#define BPF_MEMCG_CALL(memcg, op, default_val) ({ \ + typeof(default_val) __ret = (default_val); \ + struct memcg_bpf_ops *__ops; \ + int __idx; \ + \ + __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 #151: FILE: include/linux/memcontrol.h:638: +extern void memcontrol_bpf_online(struct mem_cgroup *memcg); CHECK: extern prototypes should be avoided in .h files #152: FILE: include/linux/memcontrol.h:639: +extern void memcontrol_bpf_offline(struct mem_cgroup *memcg); CHECK: Alignment should match open parenthesis #295: FILE: mm/bpf_memcontrol.c:256: +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 #301: FILE: mm/bpf_memcontrol.c:262: +static bool memcg_ops_is_valid_access(int off, int size, enum bpf_access_type type, CHECK: Alignment should match open parenthesis #302: FILE: mm/bpf_memcontrol.c:263: +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 #351: FILE: mm/bpf_memcontrol.c:312: +static int bpf_memcg_ops_check_member(const struct btf_type *t, + const struct btf_member *member, CHECK: Alignment should match open parenthesis #374: FILE: mm/bpf_memcontrol.c:335: +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 #402: FILE: mm/bpf_memcontrol.c:363: + 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 #434: FILE: mm/bpf_memcontrol.c:395: + 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 #502: FILE: mm/memcontrol.c:2298: + if (nr_pages) { [...] + penalty_jiffies += calculate_high_delay( [...] CHECK: Lines should not end with a '(' #503: FILE: mm/memcontrol.c:2299: + penalty_jiffies = calculate_high_delay( CHECK: Lines should not end with a '(' #508: FILE: mm/memcontrol.c:2302: + penalty_jiffies += calculate_high_delay( CHECK: Unbalanced braces around else statement #510: FILE: mm/memcontrol.c:2304: + } else total: 0 errors, 1 warnings, 13 checks, 493 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 698f2e7e7514 ("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, 493 lines checked