* [XFRM]: Do not define km_migrate() if !CONFIG_XFRM_MIGRATE
@ 2008-01-03 17:24 Eric Dumazet
2008-01-04 4:43 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2008-01-03 17:24 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org
In include/net/xfrm.h we find :
#ifdef CONFIG_XFRM_MIGRATE
extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
struct xfrm_migrate *m, int num_bundles);
...
#endif
We can also guard the function body itself in net/xfrm/xfrm_state.c
with same condition.
(Problem spoted by sparse checker)
make C=2 net/xfrm/xfrm_state.o
...
net/xfrm/xfrm_state.c:1765:5: warning: symbol 'km_migrate' was not declared. Should it be static?
...
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 4dec655..65f5ea4 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1762,6 +1762,7 @@ void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid)
}
EXPORT_SYMBOL(km_policy_expired);
+#ifdef CONFIG_XFRM_MIGRATE
int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
struct xfrm_migrate *m, int num_migrate)
{
@@ -1781,6 +1782,7 @@ int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
return err;
}
EXPORT_SYMBOL(km_migrate);
+#endif
int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
{
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [XFRM]: Do not define km_migrate() if !CONFIG_XFRM_MIGRATE
2008-01-03 17:24 [XFRM]: Do not define km_migrate() if !CONFIG_XFRM_MIGRATE Eric Dumazet
@ 2008-01-04 4:43 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-01-04 4:43 UTC (permalink / raw)
To: dada1; +Cc: netdev
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Thu, 3 Jan 2008 18:24:49 +0100
> In include/net/xfrm.h we find :
>
> #ifdef CONFIG_XFRM_MIGRATE
> extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
> struct xfrm_migrate *m, int num_bundles);
> ...
> #endif
>
> We can also guard the function body itself in net/xfrm/xfrm_state.c
> with same condition.
>
> (Problem spoted by sparse checker)
> make C=2 net/xfrm/xfrm_state.o
> ...
> net/xfrm/xfrm_state.c:1765:5: warning: symbol 'km_migrate' was not declared. Should it be static?
> ...
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Applied to net-2.6, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-04 4:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-03 17:24 [XFRM]: Do not define km_migrate() if !CONFIG_XFRM_MIGRATE Eric Dumazet
2008-01-04 4:43 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox