WARNING: line length of 87 exceeds 80 columns #72: FILE: arch/x86/net/bpf_jit_comp.c:2599: + emit_indirect_jump(&prog, insn->dst_reg, image + addrs[i - 1]); WARNING: line length of 86 exceeds 80 columns #114: FILE: include/linux/bpf_verifier.h:555: + struct bpf_iarray *jt; /* jump table for gotox instruction */ WARNING: line length of 89 exceeds 80 columns #152: 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 #239: FILE: kernel/bpf/verifier.c:2987: +static struct bpf_subprog_info *find_containing_subprog(struct bpf_verifier_env *env, int off) WARNING: line length of 90 exceeds 80 columns #280: FILE: kernel/bpf/verifier.c:6117: + err = check_mem_region_access(env, regno, off, size, mem_size, zero_size_allowed); WARNING: line length of 85 exceeds 80 columns #296: FILE: kernel/bpf/verifier.c:7640: + regs[value_regno].s32_min_value = reg->s32_min_value; WARNING: line length of 85 exceeds 80 columns #297: FILE: kernel/bpf/verifier.c:7641: + regs[value_regno].s32_max_value = reg->s32_max_value; WARNING: line length of 85 exceeds 80 columns #298: FILE: kernel/bpf/verifier.c:7642: + regs[value_regno].u32_min_value = reg->u32_min_value; WARNING: line length of 85 exceeds 80 columns #299: FILE: kernel/bpf/verifier.c:7643: + regs[value_regno].u32_max_value = reg->u32_max_value; WARNING: line length of 98 exceeds 80 columns #330: FILE: kernel/bpf/verifier.c:14661: + verbose(env, "Operation %s on ptr to instruction set map is prohibited\n", ERROR: Macros with complex values should be enclosed in parentheses #351: FILE: kernel/bpf/verifier.c:17771: +#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 #354: FILE: kernel/bpf/verifier.c:17774: +static int push_gotox_edge(int t, struct bpf_verifier_env *env, struct bpf_iarray *jt) WARNING: line length of 82 exceeds 80 columns #422: FILE: kernel/bpf/verifier.c:17842: +static int copy_insn_array_uniq(struct bpf_map *map, u32 start, u32 end, u32 *off) WARNING: line length of 81 exceeds 80 columns #441: FILE: kernel/bpf/verifier.c:17861: + /* this is what callers always want, so simplify the call site */ WARNING: line length of 86 exceeds 80 columns #500: FILE: kernel/bpf/verifier.c:17920: + if (jt_cur->off[0] >= subprog_start && jt_cur->off[0] < subprog_end) { WARNING: Missing a blank line after declarations #502: FILE: kernel/bpf/verifier.c:17922: + 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 #507: FILE: kernel/bpf/verifier.c:17927: + memcpy(jt->off + old_cnt, jt_cur->off, jt_cur->off_cnt << 2); WARNING: line length of 97 exceeds 80 columns #514: FILE: kernel/bpf/verifier.c:17934: + verbose(env, "no jump tables found for subprog starting at %u\n", subprog_start); WARNING: line length of 82 exceeds 80 columns #535: FILE: kernel/bpf/verifier.c:17955: + verbose(env, "can't find subprog containing instruction %d\n", t); WARNING: line length of 93 exceeds 80 columns #545: FILE: kernel/bpf/verifier.c:17965: + /* Check that the every element of the jump table fits within the given subprogram */ WARNING: line length of 100 exceeds 80 columns #548: FILE: kernel/bpf/verifier.c:17968: + verbose(env, "jump table for insn %d points outside of the subprog [%u,%u]", CHECK: Alignment should match open parenthesis #549: FILE: kernel/bpf/verifier.c:17969: + 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 #631: FILE: kernel/bpf/verifier.c:20148: + if (check_add_overflow(reg->umin_value, reg->off, &min_index) || + (min_index > (u64) U32_MAX * sizeof(long))) { CHECK: No space is necessary after a cast #631: FILE: kernel/bpf/verifier.c:20148: + (min_index > (u64) U32_MAX * sizeof(long))) { WARNING: line length of 86 exceeds 80 columns #632: FILE: kernel/bpf/verifier.c:20149: + verbose(env, "the sum of R%u umin_value %llu and off %u is too big\n", CHECK: Alignment should match open parenthesis #633: FILE: kernel/bpf/verifier.c:20150: + 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 #637: FILE: kernel/bpf/verifier.c:20154: + if (check_add_overflow(reg->umax_value, reg->off, &max_index) || + (max_index > (u64) U32_MAX * sizeof(long))) { CHECK: No space is necessary after a cast #637: FILE: kernel/bpf/verifier.c:20154: + (max_index > (u64) U32_MAX * sizeof(long))) { WARNING: line length of 86 exceeds 80 columns #638: FILE: kernel/bpf/verifier.c:20155: + verbose(env, "the sum of R%u umax_value %llu and off %u is too big\n", CHECK: Alignment should match open parenthesis #639: FILE: kernel/bpf/verifier.c:20156: + 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 #647: FILE: kernel/bpf/verifier.c:20164: + verbose(env, "R%u points to outside of jump table: [%llu,%llu] max_entries %u\n", CHECK: Alignment should match open parenthesis #648: FILE: kernel/bpf/verifier.c:20165: + 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 #658: FILE: kernel/bpf/verifier.c:20175: +static int check_indirect_jump(struct bpf_verifier_env *env, struct bpf_insn *insn) CHECK: Alignment should match open parenthesis #672: FILE: kernel/bpf/verifier.c:20189: + 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 #677: FILE: kernel/bpf/verifier.c:20194: + if (verifier_bug_if(!map, env, "R%d has an empty map pointer", insn->dst_reg)) WARNING: line length of 91 exceeds 80 columns #681: FILE: kernel/bpf/verifier.c:20198: + "R%d has incorrect map type %d", insn->dst_reg, map->map_type)) WARNING: line length of 91 exceeds 80 columns #684: FILE: kernel/bpf/verifier.c:20201: + err = indirect_jump_min_max_index(env, insn->dst_reg, map, &min_index, &max_index); WARNING: line length of 84 exceeds 80 columns #688: FILE: kernel/bpf/verifier.c:20205: + xoff = kvcalloc(max_index - min_index + 1, sizeof(u32), GFP_KERNEL_ACCOUNT); WARNING: line length of 87 exceeds 80 columns #698: FILE: kernel/bpf/verifier.c:20215: + verbose(env, "register R%d doesn't point to any offset in map id=%d\n", CHECK: Alignment should match open parenthesis #699: FILE: kernel/bpf/verifier.c:20216: + 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) #711: FILE: kernel/bpf/verifier.c:20228: + env->insn_idx = xoff[n-1]; ^ WARNING: line length of 82 exceeds 80 columns #744: FILE: kernel/bpf/verifier.c:21399: + * Clean up dynamically allocated fields of aux data for instructions [start, ...] WARNING: line length of 87 exceeds 80 columns #746: FILE: kernel/bpf/verifier.c:21401: +static void clear_insn_aux_data(struct bpf_insn_aux_data *aux_data, int start, int len) WARNING: line length of 95 exceeds 80 columns #811: FILE: kernel/bpf/verifier.c:24634: + /* pre-allocated array of size up to 2; reset cnt, as it may be used already */ CHECK: Blank lines aren't necessary before a close brace '}' #853: FILE: kernel/bpf/verifier.c:24852: + + } CHECK: Blank lines aren't necessary before a close brace '}' #894: FILE: kernel/bpf/verifier.c:25027: + + } total: 1 errors, 32 warnings, 13 checks, 808 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 8a114bde99d0 ("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.