From: Ying Xue Date: Wed, 19 Aug 2015 07:46:17 +0000 (+0800) Subject: lwtunnel: Fix the sparse warnings in fib_encap_match X-Git-Tag: v4.3-rc1~96^2~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=824e7383e92815cb591793c74cc836aa5165f7f8;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git lwtunnel: Fix the sparse warnings in fib_encap_match When CONFIG_LWTUNNEL config is not enabled, the lwtstate_free() is not declared in lwtunnel.h at all. However, even in this case, the function is still referenced in fib_semantics.c so that there appears the following sparse warnings: net/ipv4/fib_semantics.c:553:17: error: undefined identifier 'lwtstate_free' CC net/ipv4/fib_semantics.o net/ipv4/fib_semantics.c: In function ‘fib_encap_match’: net/ipv4/fib_semantics.c:553:3: error: implicit declaration of function ‘lwtstate_free’ [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make[1]: *** [net/ipv4/fib_semantics.o] Error 1 make: *** [net/ipv4/fib_semantics.o] Error 2 To eliminate the error, we define an empty function for lwtstate_free() in lwtunnel.h when CONFIG_LWTUNNEL is disabled. Fixes: df383e6240ef ("lwtunnel: fix memory leak") Cc: Jiri Benc Reported-by: kbuild test robot Signed-off-by: Ying Xue Acked-by: Jiri Benc Signed-off-by: David S. Miller --- diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h index 34fd8f7..cfee539 100644 --- a/include/net/lwtunnel.h +++ b/include/net/lwtunnel.h @@ -93,6 +93,10 @@ int lwtunnel_input6(struct sk_buff *skb); #else +static inline void lwtstate_free(struct lwtunnel_state *lws) +{ +} + static inline struct lwtunnel_state * lwtstate_get(struct lwtunnel_state *lws) {