Return-Path: From: Sven Eckelmann Date: Sat, 12 May 2012 10:45:53 +0200 Message-Id: <1336812353-25309-1-git-send-email-sven@narfation.org> In-Reply-To: <1336781383-15649-7-git-send-email-sven@narfation.org> References: <1336781383-15649-7-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCHv4 07/23] batman-adv: Prefix compat non-static functions with batadv_ Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org batman-adv can be compiled as part of the kernel instead of an module. In that case the linker will see all non-static symbols of batman-adv and all other non-static symbols of the kernel. This could lead to symbol collisions. A prefix for the batman-adv symbols that defines their private namespace avoids such a problem. Reported-by: David Miller Signed-off-by: Sven Eckelmann --- Corrected declaration of batadv_free_rcu_* compat.c | 8 ++++---- compat.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compat.c b/compat.c index 35ad397..702c7c1 100644 --- a/compat.c +++ b/compat.c @@ -28,7 +28,7 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) -void free_rcu_gw_node(struct rcu_head *rcu) +void batadv_free_rcu_gw_node(struct rcu_head *rcu) { struct gw_node *gw_node; @@ -36,7 +36,7 @@ void free_rcu_gw_node(struct rcu_head *rcu) kfree(gw_node); } -void free_rcu_neigh_node(struct rcu_head *rcu) +void batadv_free_rcu_neigh_node(struct rcu_head *rcu) { struct neigh_node *neigh_node; @@ -44,7 +44,7 @@ void free_rcu_neigh_node(struct rcu_head *rcu) kfree(neigh_node); } -void free_rcu_tt_local_entry(struct rcu_head *rcu) +void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu) { struct tt_common_entry *tt_common_entry; struct tt_local_entry *tt_local_entry; @@ -56,7 +56,7 @@ void free_rcu_tt_local_entry(struct rcu_head *rcu) } #ifdef CONFIG_BATMAN_ADV_BLA -void free_rcu_backbone_gw(struct rcu_head *rcu) +void batadv_free_rcu_backbone_gw(struct rcu_head *rcu) { struct backbone_gw *backbone_gw; diff --git a/compat.h b/compat.h index 33c52d3..13ca624 100644 --- a/compat.h +++ b/compat.h @@ -138,13 +138,13 @@ static inline int __param_set_copystring(const char *val, #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) -#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, free_rcu_##ptr) +#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr) #define vlan_insert_tag(skb, vid) __vlan_put_tag(skb, vid) -void free_rcu_gw_node(struct rcu_head *rcu); -void free_rcu_neigh_node(struct rcu_head *rcu); -void free_rcu_tt_local_entry(struct rcu_head *rcu); -void free_rcu_backbone_gw(struct rcu_head *rcu); +void batadv_free_rcu_gw_node(struct rcu_head *rcu); +void batadv_free_rcu_neigh_node(struct rcu_head *rcu); +void batadv_free_rcu_tt_local_entry(struct rcu_head *rcu); +void batadv_free_rcu_backbone_gw(struct rcu_head *rcu); #endif /* < KERNEL_VERSION(3, 0, 0) */ -- 1.7.10