diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:23 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:14 -0400 |
commit | 40a072d777a4f417c0296e06f91297b0f3f2fa36 (patch) | |
tree | 1490957336c2873cd3ec5e586927e92bc3e9a17a /net | |
parent | 81c524f76a353a19097e004ec05e4d62fd0bd57e (diff) |
batman-adv: Prefix bat_debugfs non-static functions with batadv_
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 <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/bat_debugfs.c | 10 | ||||
-rw-r--r-- | net/batman-adv/bat_debugfs.h | 8 | ||||
-rw-r--r-- | net/batman-adv/main.c | 4 | ||||
-rw-r--r-- | net/batman-adv/main.h | 5 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.c | 6 |
5 files changed, 17 insertions, 16 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c index db8273c26989..444d10bc9552 100644 --- a/net/batman-adv/bat_debugfs.c +++ b/net/batman-adv/bat_debugfs.c | |||
@@ -76,7 +76,7 @@ static int fdebug_log(struct debug_log *debug_log, const char *fmt, ...) | |||
76 | return 0; | 76 | return 0; |
77 | } | 77 | } |
78 | 78 | ||
79 | int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) | 79 | int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) |
80 | { | 80 | { |
81 | va_list args; | 81 | va_list args; |
82 | char tmp_log_buf[256]; | 82 | char tmp_log_buf[256]; |
@@ -304,7 +304,7 @@ static struct bat_debuginfo *mesh_debuginfos[] = { | |||
304 | NULL, | 304 | NULL, |
305 | }; | 305 | }; |
306 | 306 | ||
307 | void debugfs_init(void) | 307 | void batadv_debugfs_init(void) |
308 | { | 308 | { |
309 | struct bat_debuginfo *bat_debug; | 309 | struct bat_debuginfo *bat_debug; |
310 | struct dentry *file; | 310 | struct dentry *file; |
@@ -327,7 +327,7 @@ out: | |||
327 | return; | 327 | return; |
328 | } | 328 | } |
329 | 329 | ||
330 | void debugfs_destroy(void) | 330 | void batadv_debugfs_destroy(void) |
331 | { | 331 | { |
332 | if (bat_debugfs) { | 332 | if (bat_debugfs) { |
333 | debugfs_remove_recursive(bat_debugfs); | 333 | debugfs_remove_recursive(bat_debugfs); |
@@ -335,7 +335,7 @@ void debugfs_destroy(void) | |||
335 | } | 335 | } |
336 | } | 336 | } |
337 | 337 | ||
338 | int debugfs_add_meshif(struct net_device *dev) | 338 | int batadv_debugfs_add_meshif(struct net_device *dev) |
339 | { | 339 | { |
340 | struct bat_priv *bat_priv = netdev_priv(dev); | 340 | struct bat_priv *bat_priv = netdev_priv(dev); |
341 | struct bat_debuginfo **bat_debug; | 341 | struct bat_debuginfo **bat_debug; |
@@ -378,7 +378,7 @@ out: | |||
378 | #endif /* CONFIG_DEBUG_FS */ | 378 | #endif /* CONFIG_DEBUG_FS */ |
379 | } | 379 | } |
380 | 380 | ||
381 | void debugfs_del_meshif(struct net_device *dev) | 381 | void batadv_debugfs_del_meshif(struct net_device *dev) |
382 | { | 382 | { |
383 | struct bat_priv *bat_priv = netdev_priv(dev); | 383 | struct bat_priv *bat_priv = netdev_priv(dev); |
384 | 384 | ||
diff --git a/net/batman-adv/bat_debugfs.h b/net/batman-adv/bat_debugfs.h index d605c6746428..3b206c811263 100644 --- a/net/batman-adv/bat_debugfs.h +++ b/net/batman-adv/bat_debugfs.h | |||
@@ -25,9 +25,9 @@ | |||
25 | 25 | ||
26 | #define DEBUGFS_BAT_SUBDIR "batman_adv" | 26 | #define DEBUGFS_BAT_SUBDIR "batman_adv" |
27 | 27 | ||
28 | void debugfs_init(void); | 28 | void batadv_debugfs_init(void); |
29 | void debugfs_destroy(void); | 29 | void batadv_debugfs_destroy(void); |
30 | int debugfs_add_meshif(struct net_device *dev); | 30 | int batadv_debugfs_add_meshif(struct net_device *dev); |
31 | void debugfs_del_meshif(struct net_device *dev); | 31 | void batadv_debugfs_del_meshif(struct net_device *dev); |
32 | 32 | ||
33 | #endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */ | 33 | #endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */ |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 1f064d430a29..46a35e1c67ca 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -66,7 +66,7 @@ static int __init batman_init(void) | |||
66 | return -ENOMEM; | 66 | return -ENOMEM; |
67 | 67 | ||
68 | bat_socket_init(); | 68 | bat_socket_init(); |
69 | debugfs_init(); | 69 | batadv_debugfs_init(); |
70 | 70 | ||
71 | register_netdevice_notifier(&hard_if_notifier); | 71 | register_netdevice_notifier(&hard_if_notifier); |
72 | 72 | ||
@@ -78,7 +78,7 @@ static int __init batman_init(void) | |||
78 | 78 | ||
79 | static void __exit batman_exit(void) | 79 | static void __exit batman_exit(void) |
80 | { | 80 | { |
81 | debugfs_destroy(); | 81 | batadv_debugfs_destroy(); |
82 | unregister_netdevice_notifier(&hard_if_notifier); | 82 | unregister_netdevice_notifier(&hard_if_notifier); |
83 | hardif_remove_interfaces(); | 83 | hardif_remove_interfaces(); |
84 | 84 | ||
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index 6e0cbdc48321..ea9d433ad46d 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h | |||
@@ -167,12 +167,13 @@ int bat_algo_select(struct bat_priv *bat_priv, char *name); | |||
167 | int bat_algo_seq_print_text(struct seq_file *seq, void *offset); | 167 | int bat_algo_seq_print_text(struct seq_file *seq, void *offset); |
168 | 168 | ||
169 | #ifdef CONFIG_BATMAN_ADV_DEBUG | 169 | #ifdef CONFIG_BATMAN_ADV_DEBUG |
170 | int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) __printf(2, 3); | 170 | int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) |
171 | __printf(2, 3); | ||
171 | 172 | ||
172 | #define bat_dbg(type, bat_priv, fmt, arg...) \ | 173 | #define bat_dbg(type, bat_priv, fmt, arg...) \ |
173 | do { \ | 174 | do { \ |
174 | if (atomic_read(&bat_priv->log_level) & type) \ | 175 | if (atomic_read(&bat_priv->log_level) & type) \ |
175 | debug_log(bat_priv, fmt, ## arg); \ | 176 | batadv_debug_log(bat_priv, fmt, ## arg);\ |
176 | } \ | 177 | } \ |
177 | while (0) | 178 | while (0) |
178 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ | 179 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 304a7ba09e03..0f0003b00f8c 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -419,7 +419,7 @@ struct net_device *softif_create(const char *name) | |||
419 | if (ret < 0) | 419 | if (ret < 0) |
420 | goto free_bat_counters; | 420 | goto free_bat_counters; |
421 | 421 | ||
422 | ret = debugfs_add_meshif(soft_iface); | 422 | ret = batadv_debugfs_add_meshif(soft_iface); |
423 | if (ret < 0) | 423 | if (ret < 0) |
424 | goto unreg_sysfs; | 424 | goto unreg_sysfs; |
425 | 425 | ||
@@ -430,7 +430,7 @@ struct net_device *softif_create(const char *name) | |||
430 | return soft_iface; | 430 | return soft_iface; |
431 | 431 | ||
432 | unreg_debugfs: | 432 | unreg_debugfs: |
433 | debugfs_del_meshif(soft_iface); | 433 | batadv_debugfs_del_meshif(soft_iface); |
434 | unreg_sysfs: | 434 | unreg_sysfs: |
435 | sysfs_del_meshif(soft_iface); | 435 | sysfs_del_meshif(soft_iface); |
436 | free_bat_counters: | 436 | free_bat_counters: |
@@ -447,7 +447,7 @@ out: | |||
447 | 447 | ||
448 | void softif_destroy(struct net_device *soft_iface) | 448 | void softif_destroy(struct net_device *soft_iface) |
449 | { | 449 | { |
450 | debugfs_del_meshif(soft_iface); | 450 | batadv_debugfs_del_meshif(soft_iface); |
451 | sysfs_del_meshif(soft_iface); | 451 | sysfs_del_meshif(soft_iface); |
452 | mesh_free(soft_iface); | 452 | mesh_free(soft_iface); |
453 | unregister_netdevice(soft_iface); | 453 | unregister_netdevice(soft_iface); |