/************** Functions that the back-end must provide **************/
 /* Extension for 32-bit operations. */
-inline u8 zext(u8 *buf, u8 rd);
+u8 zext(u8 *buf, u8 rd);
 /***** Moves *****/
 u8 mov_r32(u8 *buf, u8 rd, u8 rs, u8 sign_ext);
 u8 mov_r32_i32(u8 *buf, u8 reg, s32 imm);
 
  *   If/when we decide to add ARCv2 instructions that do use register pairs,
  *   the mapping, hopefully, doesn't need to be revisited.
  */
-const u8 bpf2arc[][2] = {
+static const u8 bpf2arc[][2] = {
        /* Return value from in-kernel function, and exit value from eBPF */
        [BPF_REG_0] = {ARC_R_8, ARC_R_9},
        /* Arguments from eBPF program to in-kernel function */
 
 /************* Packers (Deal with BPF_REGs) **************/
 
-inline u8 zext(u8 *buf, u8 rd)
+u8 zext(u8 *buf, u8 rd)
 {
        if (rd != BPF_REG_FP)
                return arc_movi_r(buf, REG_HI(rd), 0);
                        break;
                default:
                        /* The caller must have handled this. */
+                       break;
                }
        } else {
                /*
                        break;
                default:
                        /* The caller must have handled this. */
+                       break;
                }
        }
 
 #define JCC64_NR_OF_JMPS 3     /* Number of jumps in jcc64 template. */
 #define JCC64_INSNS_TO_END 3   /* Number of insn. inclusive the 2nd jmp to end. */
 #define JCC64_SKIP_JMP 1       /* Index of the "skip" jump to "end". */
-const struct {
+static const struct {
        /*
         * "jit_off" is common between all "jmp[]" and is coupled with
         * "cond" of each "jmp[]" instance. e.g.:
  * The "ARC_CC_SET" becomes "CC_unequal" because of the "tst"
  * instruction that precedes the conditional branch.
  */
-const u8 arcv2_32_jmps[ARC_CC_LAST] = {
+static const u8 arcv2_32_jmps[ARC_CC_LAST] = {
        [ARC_CC_UGT] = CC_great_u,
        [ARC_CC_UGE] = CC_great_eq_u,
        [ARC_CC_ULT] = CC_less_u,
 
 /* Initialise the context so there's no garbage. */
 static int jit_ctx_init(struct jit_context *ctx, struct bpf_prog *prog)
 {
-       memset(ctx, 0, sizeof(ctx));
+       memset(ctx, 0, sizeof(*ctx));
 
        ctx->orig_prog = prog;
 
        ctx->prog = bpf_jit_blind_constants(prog);
        if (IS_ERR(ctx->prog))
                return PTR_ERR(ctx->prog);
-       ctx->blinded = (ctx->prog == ctx->orig_prog ? false : true);
+       ctx->blinded = (ctx->prog != ctx->orig_prog);
 
        /* If the verifier doesn't zero-extend, then we have to do it. */
        ctx->do_zext = !ctx->prog->aux->verifier_zext;
 }
 
 /*
- * All the "handle_*()" functions have been called before by the
- * "jit_prepare()". If there was an error, we would know by now.
- * Therefore, no extra error checking at this point, other than
- * a sanity check at the end that expects the calculated length
- * (jit.len) to be equal to the length of generated instructions
- * (jit.index).
+ * jit_compile() is the real compilation phase. jit_prepare() is
+ * invoked before jit_compile() as a dry-run to make sure everything
+ * will go OK and allocate the necessary memory.
+ *
+ * In the end, jit_compile() checks if it has produced the same number
+ * of instructions as jit_prepare() would.
  */
 static int jit_compile(struct jit_context *ctx)
 {
 
 /*
  * This function may be invoked twice for the same stream of BPF
- * instructions. The "extra pass" happens, when there are "call"s
- * involved that their addresses are not known during the first
- * invocation.
+ * instructions. The "extra pass" happens, when there are
+ * (re)locations involved that their addresses are not known
+ * during the first run.
  */
 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 {