aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-05-14 23:14:50 +0200
committerSven Eckelmann <sven@narfation.org>2011-05-30 07:39:31 +0200
commit747e4221a03cde62402b614ca1f8e961b8416130 (patch)
tree98428064fef191a5093e276d5a779b9e801a97f0 /net/batman-adv/main.h
parentbatman-adv: Don't do pointer arithmetic with void* (diff)
downloadlinux-dev-747e4221a03cde62402b614ca1f8e961b8416130.tar.xz
linux-dev-747e4221a03cde62402b614ca1f8e961b8416130.zip
batman-adv: Add const type qualifier for pointers
batman-adv uses pointers which are marked as const and should not violate that type qualifier by passing it to functions which force a cast to the non-const version. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index ba28436bcdd6..0150897acf63 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -133,10 +133,10 @@ int mesh_init(struct net_device *soft_iface);
void mesh_free(struct net_device *soft_iface);
void inc_module_count(void);
void dec_module_count(void);
-int is_my_mac(uint8_t *addr);
+int is_my_mac(const uint8_t *addr);
#ifdef CONFIG_BATMAN_ADV_DEBUG
-int debug_log(struct bat_priv *bat_priv, char *fmt, ...) __printf(2, 3);
+int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) __printf(2, 3);
#define bat_dbg(type, bat_priv, fmt, arg...) \
do { \
@@ -148,7 +148,7 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...) __printf(2, 3);
__printf(3, 4)
static inline void bat_dbg(char type __always_unused,
struct bat_priv *bat_priv __always_unused,
- char *fmt __always_unused, ...)
+ const char *fmt __always_unused, ...)
{
}
#endif
@@ -173,11 +173,13 @@ static inline void bat_dbg(char type __always_unused,
*
* note: can't use compare_ether_addr() as it requires aligned memory
*/
-static inline int compare_eth(void *data1, void *data2)
+
+static inline int compare_eth(const void *data1, const void *data2)
{
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
}
+
#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
#endif /* _NET_BATMAN_ADV_MAIN_H_ */