* [PATCH] lwtunnel: Fix the sparse warnings in fib_encap_match
@ 2015-08-19 7:33 Ying Xue
2015-08-19 7:40 ` Jiri Benc
0 siblings, 1 reply; 3+ messages in thread
From: Ying Xue @ 2015-08-19 7:33 UTC (permalink / raw)
To: netdev; +Cc: davem, jbenc, fengguang.wu, kbuild-all
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 <jbenc@redhat.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
include/net/lwtunnel.h | 4 ++++
1 file changed, 4 insertions(+)
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)
{
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] lwtunnel: Fix the sparse warnings in fib_encap_match
2015-08-19 7:33 [PATCH] lwtunnel: Fix the sparse warnings in fib_encap_match Ying Xue
@ 2015-08-19 7:40 ` Jiri Benc
2015-08-19 7:41 ` Ying Xue
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Benc @ 2015-08-19 7:40 UTC (permalink / raw)
To: Ying Xue; +Cc: netdev, davem, fengguang.wu, kbuild-all
On Wed, 19 Aug 2015 15:33:29 +0800, Ying Xue wrote:
> 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 <jbenc@redhat.com>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jiri Benc <jbenc@redhat.com>
Thanks, you beat me to it.
This is for net-next.
Jiri
--
Jiri Benc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lwtunnel: Fix the sparse warnings in fib_encap_match
2015-08-19 7:40 ` Jiri Benc
@ 2015-08-19 7:41 ` Ying Xue
0 siblings, 0 replies; 3+ messages in thread
From: Ying Xue @ 2015-08-19 7:41 UTC (permalink / raw)
To: Jiri Benc; +Cc: netdev, davem, fengguang.wu, kbuild-all
On 08/19/2015 03:40 PM, Jiri Benc wrote:
> On Wed, 19 Aug 2015 15:33:29 +0800, Ying Xue wrote:
>> 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 <jbenc@redhat.com>
>> Reported-by: kbuild test robot <fengguang.wu@intel.com>
>> Signed-off-by: Ying Xue <ying.xue@windriver.com>
>
> Acked-by: Jiri Benc <jbenc@redhat.com>
>
> Thanks, you beat me to it.
>
> This is for net-next.
>
Yes, I found I made a mistake after I sent out the patch.
I will resend the patch to net-next tree again.
Thanks,
Ying
> Jiri
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-19 7:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 7:33 [PATCH] lwtunnel: Fix the sparse warnings in fib_encap_match Ying Xue
2015-08-19 7:40 ` Jiri Benc
2015-08-19 7:41 ` Ying Xue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).