diff options
author | Sven Eckelmann <sven@narfation.org> | 2011-05-14 17:14:50 -0400 |
---|---|---|
committer | Sven Eckelmann <sven@narfation.org> | 2011-05-30 01:39:31 -0400 |
commit | 747e4221a03cde62402b614ca1f8e961b8416130 (patch) | |
tree | 98428064fef191a5093e276d5a779b9e801a97f0 /net/batman-adv/main.h | |
parent | 38e3c5f0dae7a3bbb32c3b2bb28c3f2557d40fe9 (diff) |
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.h | 10 |
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); | |||
133 | void mesh_free(struct net_device *soft_iface); | 133 | void mesh_free(struct net_device *soft_iface); |
134 | void inc_module_count(void); | 134 | void inc_module_count(void); |
135 | void dec_module_count(void); | 135 | void dec_module_count(void); |
136 | int is_my_mac(uint8_t *addr); | 136 | int is_my_mac(const uint8_t *addr); |
137 | 137 | ||
138 | #ifdef CONFIG_BATMAN_ADV_DEBUG | 138 | #ifdef CONFIG_BATMAN_ADV_DEBUG |
139 | int debug_log(struct bat_priv *bat_priv, char *fmt, ...) __printf(2, 3); | 139 | int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) __printf(2, 3); |
140 | 140 | ||
141 | #define bat_dbg(type, bat_priv, fmt, arg...) \ | 141 | #define bat_dbg(type, bat_priv, fmt, arg...) \ |
142 | do { \ | 142 | do { \ |
@@ -148,7 +148,7 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...) __printf(2, 3); | |||
148 | __printf(3, 4) | 148 | __printf(3, 4) |
149 | static inline void bat_dbg(char type __always_unused, | 149 | static inline void bat_dbg(char type __always_unused, |
150 | struct bat_priv *bat_priv __always_unused, | 150 | struct bat_priv *bat_priv __always_unused, |
151 | char *fmt __always_unused, ...) | 151 | const char *fmt __always_unused, ...) |
152 | { | 152 | { |
153 | } | 153 | } |
154 | #endif | 154 | #endif |
@@ -173,11 +173,13 @@ static inline void bat_dbg(char type __always_unused, | |||
173 | * | 173 | * |
174 | * note: can't use compare_ether_addr() as it requires aligned memory | 174 | * note: can't use compare_ether_addr() as it requires aligned memory |
175 | */ | 175 | */ |
176 | static inline int compare_eth(void *data1, void *data2) | 176 | |
177 | static inline int compare_eth(const void *data1, const void *data2) | ||
177 | { | 178 | { |
178 | return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); | 179 | return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); |
179 | } | 180 | } |
180 | 181 | ||
182 | |||
181 | #define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0) | 183 | #define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0) |
182 | 184 | ||
183 | #endif /* _NET_BATMAN_ADV_MAIN_H_ */ | 185 | #endif /* _NET_BATMAN_ADV_MAIN_H_ */ |