]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
bpf, verifier: annotate verbose printer with __printf
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 3 Nov 2015 10:39:20 +0000 (11:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Nov 2015 16:29:56 +0000 (11:29 -0500)
The verbose() printer dumps the verifier state to user space, so let gcc
take care to check calls to verbose() for (future) errors. make with W=1
correctly suggests: function might be possible candidate for 'gnu_printf'
format attribute [-Wsuggest-attribute=format].

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/verifier.c

index fdc88c5a60e356f89e70c7a3704572c34c6d5e5a..c6073056badf02293c7e9d1e35dce9bb88536c67 100644 (file)
@@ -214,7 +214,7 @@ static DEFINE_MUTEX(bpf_verifier_lock);
  * verbose() is used to dump the verification trace to the log, so the user
  * can figure out what's wrong with the program
  */
-static void verbose(const char *fmt, ...)
+static __printf(1, 2) void verbose(const char *fmt, ...)
 {
        va_list args;