Skip to contentSkip to conversation

: xfrm_state_clone() should be static, not exported

XFRM Applied Eric Dumazet 2 participants 2 messages Jan 8, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

xfrm_state_clone() is not used outside of net/xfrm/xfrm_state.c There is no need to export it.

Spoted by sparse checker.
CHECK net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c:1103:19: warning: symbol 'xfrm_state_clone' was not declared. Should it be static?

net/xfrm/xfrm_state.c +1 -2
index 81b0fce..5fc8217 100644
@@ -1100,7 +1100,7 @@ out:
 EXPORT_SYMBOL(xfrm_state_add);
 
 #ifdef CONFIG_XFRM_MIGRATE
-struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
+static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
 {
 	int err = -ENOMEM;
 	struct xfrm_state *x = xfrm_state_alloc();
@@ -1175,7 +1175,6 @@ struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
 	kfree(x);
 	return NULL;
 }
-EXPORT_SYMBOL(xfrm_state_clone);
 
 /* xfrm_state_lock is held */
 struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m)
maintainer Applied
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Tue, 08 Jan 2008 09:00:20 +0100

Quoted 9 lines

xfrm_state_clone() is not used outside of net/xfrm/xfrm_state.c There is no need to export it.

Spoted by sparse checker.
CHECK net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c:1103:19: warning: symbol 'xfrm_state_clone' was not declared. Should it be static?

Applied to net-2.6.25, thanks Eric.