bpf: make function skip_callee static and return NULL rather than 0
authorColin Ian King <colin.king@canonical.com>
Mon, 18 Dec 2017 17:47:07 +0000 (17:47 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 19 Dec 2017 00:26:04 +0000 (01:26 +0100)
Function skip_callee is local to the source and does not need to
be in global scope, so make it static. Also return NULL rather than 0.
Cleans up two sparse warnings:

symbol 'skip_callee' was not declared. Should it be static?
Using plain integer as NULL pointer

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/verifier.c

index 56ef21c71bd3a8750d317971356cd039cf097a0c..52c9b32d58bfb94c15390bbe6b638077c2166617 100644 (file)
@@ -823,6 +823,7 @@ next:
        return 0;
 }
 
+static
 struct bpf_verifier_state *skip_callee(struct bpf_verifier_env *env,
                                       const struct bpf_verifier_state *state,
                                       struct bpf_verifier_state *parent,
@@ -867,7 +868,7 @@ bug:
        verbose(env, "verifier bug regno %d tmp %p\n", regno, tmp);
        verbose(env, "regno %d parent frame %d current frame %d\n",
                regno, parent->curframe, state->curframe);
-       return 0;
+       return NULL;
 }
 
 static int mark_reg_read(struct bpf_verifier_env *env,