WARNING: line length of 87 exceeds 80 columns #73: FILE: arch/x86/net/bpf_jit_comp.c:2633: + emit_indirect_jump(&prog, insn->dst_reg, image + addrs[i - 1]); WARNING: line length of 86 exceeds 80 columns #98: FILE: include/linux/bpf_verifier.h:530: + struct bpf_iarray *jt; /* jump table for gotox instruction */ WARNING: line length of 89 exceeds 80 columns #143: FILE: kernel/bpf/bpf_insn_array.c:129: +static int insn_array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, u32 off) WARNING: line length of 81 exceeds 80 columns #216: FILE: kernel/bpf/verifier.c:2951: +static int bpf_find_containing_subprog_idx(struct bpf_verifier_env *env, int off) WARNING: line length of 91 exceeds 80 columns #236: FILE: kernel/bpf/verifier.c:2972: +struct bpf_subprog_info *bpf_find_containing_subprog(struct bpf_verifier_env *env, int off) WARNING: line length of 90 exceeds 80 columns #277: FILE: kernel/bpf/verifier.c:6027: + err = check_mem_region_access(env, regno, off, size, mem_size, zero_size_allowed); WARNING: line length of 98 exceeds 80 columns #287: FILE: kernel/bpf/verifier.c:7544: + verbose(env, "Invalid read of %d bytes from insn_array\n", CHECK: Alignment should match open parenthesis #288: FILE: kernel/bpf/verifier.c:7545: + verbose(env, "Invalid read of %d bytes from insn_array\n", + size); WARNING: line length of 96 exceeds 80 columns #322: FILE: kernel/bpf/verifier.c:14727: + verbose(env, "R%d subtraction from pointer to instruction prohibited\n", ERROR: Macros with complex values should be enclosed in parentheses #343: FILE: kernel/bpf/verifier.c:17833: +#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 86 exceeds 80 columns #346: FILE: kernel/bpf/verifier.c:17836: +static int push_gotox_edge(int t, struct bpf_verifier_env *env, struct bpf_iarray *jt) WARNING: line length of 82 exceeds 80 columns #411: FILE: kernel/bpf/verifier.c:17901: +static int copy_insn_array_uniq(struct bpf_map *map, u32 start, u32 end, u32 *off) WARNING: line length of 86 exceeds 80 columns #473: FILE: kernel/bpf/verifier.c:17963: + if (jt_cur->off[0] >= subprog_start && jt_cur->off[0] < subprog_end) { WARNING: Missing a blank line after declarations #475: FILE: kernel/bpf/verifier.c:17965: + u32 old_cnt = jt ? jt->off_cnt : 0; + jt = iarray_realloc(jt, old_cnt + jt_cur->off_cnt); WARNING: line length of 85 exceeds 80 columns #480: FILE: kernel/bpf/verifier.c:17970: + memcpy(jt->off + old_cnt, jt_cur->off, jt_cur->off_cnt << 2); WARNING: line length of 97 exceeds 80 columns #487: FILE: kernel/bpf/verifier.c:17977: + verbose(env, "no jump tables found for subprog starting at %u\n", subprog_start); WARNING: line length of 82 exceeds 80 columns #508: FILE: kernel/bpf/verifier.c:17998: + verbose(env, "can't find subprog containing instruction %d\n", t); WARNING: line length of 93 exceeds 80 columns #518: FILE: kernel/bpf/verifier.c:18008: + /* Check that the every element of the jump table fits within the given subprogram */ WARNING: line length of 100 exceeds 80 columns #521: FILE: kernel/bpf/verifier.c:18011: + verbose(env, "jump table for insn %d points outside of the subprog [%u,%u]", CHECK: Alignment should match open parenthesis #522: FILE: kernel/bpf/verifier.c:18012: + verbose(env, "jump table for insn %d points outside of the subprog [%u,%u]", + t, subprog_start, subprog_end); CHECK: Alignment should match open parenthesis #585: FILE: kernel/bpf/verifier.c:20081: + if (check_add_overflow(reg->umin_value, reg->off, &min_index) || + (min_index > (u64) U32_MAX * size)) { CHECK: No space is necessary after a cast #585: FILE: kernel/bpf/verifier.c:20081: + (min_index > (u64) U32_MAX * size)) { WARNING: line length of 86 exceeds 80 columns #586: FILE: kernel/bpf/verifier.c:20082: + verbose(env, "the sum of R%u umin_value %llu and off %u is too big\n", CHECK: Alignment should match open parenthesis #587: FILE: kernel/bpf/verifier.c:20083: + verbose(env, "the sum of R%u umin_value %llu and off %u is too big\n", + regno, reg->umin_value, reg->off); CHECK: Alignment should match open parenthesis #591: FILE: kernel/bpf/verifier.c:20087: + if (check_add_overflow(reg->umax_value, reg->off, &max_index) || + (max_index > (u64) U32_MAX * size)) { CHECK: No space is necessary after a cast #591: FILE: kernel/bpf/verifier.c:20087: + (max_index > (u64) U32_MAX * size)) { WARNING: line length of 86 exceeds 80 columns #592: FILE: kernel/bpf/verifier.c:20088: + verbose(env, "the sum of R%u umax_value %llu and off %u is too big\n", CHECK: Alignment should match open parenthesis #593: FILE: kernel/bpf/verifier.c:20089: + verbose(env, "the sum of R%u umax_value %llu and off %u is too big\n", + regno, reg->umax_value, reg->off); WARNING: line length of 97 exceeds 80 columns #601: FILE: kernel/bpf/verifier.c:20097: + verbose(env, "R%u points to outside of jump table: [%llu,%llu] max_entries %u\n", CHECK: Alignment should match open parenthesis #602: FILE: kernel/bpf/verifier.c:20098: + verbose(env, "R%u points to outside of jump table: [%llu,%llu] max_entries %u\n", + regno, min_index, max_index, map->max_entries); WARNING: line length of 83 exceeds 80 columns #612: FILE: kernel/bpf/verifier.c:20108: +static int check_indirect_jump(struct bpf_verifier_env *env, struct bpf_insn *insn) CHECK: Alignment should match open parenthesis #627: FILE: kernel/bpf/verifier.c:20123: + verbose(env, "R%d has type %d, expected PTR_TO_INSN\n", + insn->dst_reg, dst_reg->type); WARNING: line length of 86 exceeds 80 columns #632: FILE: kernel/bpf/verifier.c:20128: + if (verifier_bug_if(!map, env, "R%d has an empty map pointer", insn->dst_reg)) WARNING: line length of 91 exceeds 80 columns #636: FILE: kernel/bpf/verifier.c:20132: + "R%d has incorrect map type %d", insn->dst_reg, map->map_type)) WARNING: line length of 91 exceeds 80 columns #639: FILE: kernel/bpf/verifier.c:20135: + err = indirect_jump_min_max_index(env, insn->dst_reg, map, &min_index, &max_index); WARNING: line length of 86 exceeds 80 columns #646: FILE: kernel/bpf/verifier.c:20142: + new_buf = kvrealloc(env->gotox_tmp_buf, new_size, GFP_KERNEL_ACCOUNT); WARNING: line length of 87 exceeds 80 columns #657: FILE: kernel/bpf/verifier.c:20153: + verbose(env, "register R%d doesn't point to any offset in map id=%d\n", CHECK: Alignment should match open parenthesis #658: FILE: kernel/bpf/verifier.c:20154: + verbose(env, "register R%d doesn't point to any offset in map id=%d\n", + insn->dst_reg, map->id); WARNING: line length of 86 exceeds 80 columns #664: FILE: kernel/bpf/verifier.c:20160: + env->insn_idx, env->cur_state->speculative); CHECK: spaces preferred around that '-' (ctx:VxV) #668: FILE: kernel/bpf/verifier.c:20164: + env->insn_idx = env->gotox_tmp_buf[n-1]; ^ WARNING: line length of 92 exceeds 80 columns #682: FILE: kernel/bpf/verifier.c:20273: + verbose(env, "BPF_JA|BPF_X uses reserved fields\n"); WARNING: line length of 82 exceeds 80 columns #704: FILE: kernel/bpf/verifier.c:21354: + * Clean up dynamically allocated fields of aux data for instructions [start, ...] WARNING: line length of 81 exceeds 80 columns #706: FILE: kernel/bpf/verifier.c:21356: +static void clear_insn_aux_data(struct bpf_verifier_env *env, int start, int len) total: 1 errors, 30 warnings, 12 checks, 656 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 c697fc59a8d3 ("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.