WARNING: 'withing' may be misspelled - perhaps 'within'? #19: targets withing the current subprogram. ^^^^^^^ WARNING: line length of 82 exceeds 80 columns #88: FILE: arch/x86/net/bpf_jit_comp.c:813: + emit_indirect_jump(&prog, BPF_REG_4 /* R4 -> rcx */, ip + (prog - start)); WARNING: line length of 87 exceeds 80 columns #97: FILE: arch/x86/net/bpf_jit_comp.c:2524: + emit_indirect_jump(&prog, insn->dst_reg, image + addrs[i - 1]); WARNING: line length of 91 exceeds 80 columns #107: FILE: arch/x86/net/bpf_jit_comp.c:3462: + emit_indirect_jump(&prog, BPF_REG_3 /* R3 -> rdx */, image + (prog - buf)); WARNING: line length of 86 exceeds 80 columns #149: FILE: include/linux/bpf_verifier.h:554: + struct jt { /* jump table for gotox instruction */ WARNING: line length of 89 exceeds 80 columns #182: FILE: kernel/bpf/bpf_insn_array.c:175: +static int insn_array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, u32 off) WARNING: line length of 94 exceeds 80 columns #257: FILE: kernel/bpf/verifier.c:2982: +static struct bpf_subprog_info *find_containing_subprog(struct bpf_verifier_env *env, int off) WARNING: line length of 90 exceeds 80 columns #294: FILE: kernel/bpf/verifier.c:6108: + err = check_mem_region_access(env, regno, off, size, mem_size, zero_size_allowed); WARNING: line length of 95 exceeds 80 columns #321: FILE: kernel/bpf/verifier.c:7839: + if (src_reg_type == PTR_TO_MAP_VALUE && map_is_insn_array(regs[insn->src_reg].map_ptr)) WARNING: line length of 87 exceeds 80 columns #358: FILE: kernel/bpf/verifier.c:14599: + if ((umin_val + ptr_reg->off) > (u64) U32_MAX * sizeof(long)) { CHECK: No space is necessary after a cast #358: FILE: kernel/bpf/verifier.c:14599: + if ((umin_val + ptr_reg->off) > (u64) U32_MAX * sizeof(long)) { WARNING: line length of 108 exceeds 80 columns #359: FILE: kernel/bpf/verifier.c:14600: + verbose(env, "umin_value %llu + offset %u is too big to convert to index\n", CHECK: Alignment should match open parenthesis #360: FILE: kernel/bpf/verifier.c:14601: + verbose(env, "umin_value %llu + offset %u is too big to convert to index\n", + umin_val, ptr_reg->off); WARNING: line length of 87 exceeds 80 columns #363: FILE: kernel/bpf/verifier.c:14604: + if ((umax_val + ptr_reg->off) > (u64) U32_MAX * sizeof(long)) { CHECK: No space is necessary after a cast #363: FILE: kernel/bpf/verifier.c:14604: + if ((umax_val + ptr_reg->off) > (u64) U32_MAX * sizeof(long)) { WARNING: line length of 108 exceeds 80 columns #364: FILE: kernel/bpf/verifier.c:14605: + verbose(env, "umax_value %llu + offset %u is too big to convert to index\n", CHECK: Alignment should match open parenthesis #365: FILE: kernel/bpf/verifier.c:14606: + verbose(env, "umax_value %llu + offset %u is too big to convert to index\n", + umax_val, ptr_reg->off); WARNING: line length of 99 exceeds 80 columns #373: FILE: kernel/bpf/verifier.c:14614: + verbose(env, "min_index %u points to outside of map\n", min_index); WARNING: line length of 99 exceeds 80 columns #377: FILE: kernel/bpf/verifier.c:14618: + verbose(env, "max_index %u points to outside of map\n", max_index); WARNING: line length of 98 exceeds 80 columns #392: FILE: kernel/bpf/verifier.c:14670: + verbose(env, "Operation %s on ptr to instruction set map is prohibited\n", ERROR: Macros with complex values should be enclosed in parentheses #413: FILE: kernel/bpf/verifier.c:17773: +#define SET_HIGH(STATE, LAST) STATE = (STATE & 0xffffU) | ((LAST) << 16) 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 #484: FILE: kernel/bpf/verifier.c:17844: +static int copy_insn_array_uniq(struct bpf_map *map, u32 start, u32 end, u32 *off) WARNING: line length of 84 exceeds 80 columns #554: FILE: kernel/bpf/verifier.c:17914: + if (jt_cur.off[0] >= subprog_start && jt_cur.off[0] < subprog_end) { WARNING: line length of 106 exceeds 80 columns #555: FILE: kernel/bpf/verifier.c:17915: + off = kvrealloc(jt->off, (jt->off_cnt + jt_cur.off_cnt) << 2, GFP_KERNEL_ACCOUNT); WARNING: line length of 83 exceeds 80 columns #561: FILE: kernel/bpf/verifier.c:17921: + memcpy(off + jt->off_cnt, jt_cur.off, jt_cur.off_cnt << 2); CHECK: Comparison to NULL could be written "!jt->off" #569: FILE: kernel/bpf/verifier.c:17929: + if (jt->off == NULL) { WARNING: line length of 97 exceeds 80 columns #570: FILE: kernel/bpf/verifier.c:17930: + verbose(env, "no jump tables found for subprog starting at %u\n", subprog_start); WARNING: line length of 82 exceeds 80 columns #592: FILE: kernel/bpf/verifier.c:17952: + verbose(env, "can't find subprog containing instruction %d\n", t); WARNING: line length of 87 exceeds 80 columns #603: FILE: kernel/bpf/verifier.c:17963: + verbose(env, "map type %d in the gotox insn %d is incorrect\n", CHECK: Alignment should match open parenthesis #604: FILE: kernel/bpf/verifier.c:17964: + verbose(env, "map type %d in the gotox insn %d is incorrect\n", + map->map_type, t); WARNING: line length of 93 exceeds 80 columns #619: FILE: kernel/bpf/verifier.c:17979: + /* Check that the every element of the jump table fits within the given subprogram */ WARNING: line length of 100 exceeds 80 columns #622: FILE: kernel/bpf/verifier.c:17982: + verbose(env, "jump table for insn %d points outside of the subprog [%u,%u]", CHECK: Alignment should match open parenthesis #623: FILE: kernel/bpf/verifier.c:17983: + verbose(env, "jump table for insn %d points outside of the subprog [%u,%u]", + t, subprog_start, subprog_end); CHECK: Comparison to NULL could be written "!jt->off" #637: FILE: kernel/bpf/verifier.c:17997: + if (jt->off == NULL) { WARNING: line length of 83 exceeds 80 columns #697: FILE: kernel/bpf/verifier.c:20154: +static int check_indirect_jump(struct bpf_verifier_env *env, struct bpf_insn *insn) WARNING: line length of 84 exceeds 80 columns #709: FILE: kernel/bpf/verifier.c:20166: + verbose(env, "BPF_JA|BPF_X R%d has type %d, expected PTR_TO_INSN\n", CHECK: Alignment should match open parenthesis #710: FILE: kernel/bpf/verifier.c:20167: + verbose(env, "BPF_JA|BPF_X R%d has type %d, expected PTR_TO_INSN\n", + insn->dst_reg, dst_reg->type); WARNING: line length of 99 exceeds 80 columns #722: FILE: kernel/bpf/verifier.c:20179: + verbose(env, "BPF_JA|BPF_X R%d is out of map boundaries: index=%u, max_index=%u\n", WARNING: line length of 87 exceeds 80 columns #723: FILE: kernel/bpf/verifier.c:20180: + insn->dst_reg, dst_reg->max_index, map->max_entries-1); CHECK: Alignment should match open parenthesis #723: FILE: kernel/bpf/verifier.c:20180: + verbose(env, "BPF_JA|BPF_X R%d is out of map boundaries: index=%u, max_index=%u\n", + insn->dst_reg, dst_reg->max_index, map->max_entries-1); CHECK: spaces preferred around that '-' (ctx:VxV) #723: FILE: kernel/bpf/verifier.c:20180: + insn->dst_reg, dst_reg->max_index, map->max_entries-1); ^ WARNING: line length of 102 exceeds 80 columns #727: FILE: kernel/bpf/verifier.c:20184: + xoff = kvcalloc(dst_reg->max_index - dst_reg->min_index + 1, sizeof(u32), GFP_KERNEL_ACCOUNT); WARNING: line length of 84 exceeds 80 columns #731: FILE: kernel/bpf/verifier.c:20188: + n = copy_insn_array_uniq(map, dst_reg->min_index, dst_reg->max_index, xoff); WARNING: line length of 87 exceeds 80 columns #737: FILE: kernel/bpf/verifier.c:20194: + verbose(env, "register R%d doesn't point to any offset in map id=%d\n", CHECK: Alignment should match open parenthesis #738: FILE: kernel/bpf/verifier.c:20195: + verbose(env, "register R%d doesn't point to any offset in map id=%d\n", + insn->dst_reg, map->id); CHECK: spaces preferred around that '-' (ctx:VxV) #750: FILE: kernel/bpf/verifier.c:20207: + env->insn_idx = xoff[n-1]; ^ WARNING: line length of 87 exceeds 80 columns #783: FILE: kernel/bpf/verifier.c:21375: + * Clean up dynamically allocated fields of aux data for instructions [start, ..., end] WARNING: line length of 87 exceeds 80 columns #785: FILE: kernel/bpf/verifier.c:21377: +static void clear_insn_aux_data(struct bpf_insn_aux_data *aux_data, int start, int end) WARNING: line length of 82 exceeds 80 columns #825: FILE: kernel/bpf/verifier.c:24589: +static int insn_successors_regular(struct bpf_prog *prog, u32 insn_idx, u32 *succ) WARNING: line length of 84 exceeds 80 columns #892: FILE: kernel/bpf/verifier.c:24836: + succ_num = insn_successors(env, env->prog, insn_idx, &succ); CHECK: Blank lines aren't necessary before a close brace '}' #897: FILE: kernel/bpf/verifier.c:24841: + + } CHECK: Blank lines aren't necessary before a close brace '}' #929: FILE: kernel/bpf/verifier.c:25017: + + } total: 1 errors, 36 warnings, 15 checks, 810 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 d1b92bdbae98 ("bpf, x86: add support for indirect jumps") 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.