diff mbox

[v2] include/linux: printk is needed in filter.h when CONFIG_BPF_JIT is defined

Message ID 5154ED65.5090607@asianux.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Chen Gang March 29, 2013, 1:24 a.m. UTC
for make V=1 EXTRA_CFLAGS=-W ARCH=arm allmodconfig
    printk is need when CONFIG_BPF_JIT is defined
    or it will report pr_err and print_hex_dump are implicit declaration

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 include/linux/filter.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

David Miller March 29, 2013, 7:34 p.m. UTC | #1
From: Chen Gang <gang.chen@asianux.com>
Date: Fri, 29 Mar 2013 09:24:53 +0800

> 
>   for make V=1 EXTRA_CFLAGS=-W ARCH=arm allmodconfig
>     printk is need when CONFIG_BPF_JIT is defined
>     or it will report pr_err and print_hex_dump are implicit declaration
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>

There are no references to pr_err nor print_hex_dump in this
filter.h header file.

I think the issue is more like that the ARM bpf jit code uses
those routines, and therefore the ARM bpf jit code is what needs
to add these includes.

I'm not applying this patch, it isn't correct.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chen Gang March 30, 2013, 3:17 a.m. UTC | #2
On 2013年03月30日 03:34, David Miller wrote:
> I think the issue is more like that the ARM bpf jit code uses
> those routines, and therefore the ARM bpf jit code is what needs
> to add these includes.

  for arm, I should continue to try to find new valuable issues.

  :-)
diff mbox

Patch

diff --git a/include/linux/filter.h b/include/linux/filter.h
index d7d2508..d1248f4 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -48,6 +48,9 @@  extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
 extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len);
 
 #ifdef CONFIG_BPF_JIT
+#include <linux/linkage.h>
+#include <linux/printk.h>
+
 extern void bpf_jit_compile(struct sk_filter *fp);
 extern void bpf_jit_free(struct sk_filter *fp);