aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-05-14 17:14:50 -0400
committerSven Eckelmann <sven@narfation.org>2011-05-30 01:39:31 -0400
commit747e4221a03cde62402b614ca1f8e961b8416130 (patch)
tree98428064fef191a5093e276d5a779b9e801a97f0 /net/batman-adv/main.h
parent38e3c5f0dae7a3bbb32c3b2bb28c3f2557d40fe9 (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.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);
133void mesh_free(struct net_device *soft_iface); 133void mesh_free(struct net_device *soft_iface);
134void inc_module_count(void); 134void inc_module_count(void);
135void dec_module_count(void); 135void dec_module_count(void);
136int is_my_mac(uint8_t *addr); 136int is_my_mac(const uint8_t *addr);
137 137
138#ifdef CONFIG_BATMAN_ADV_DEBUG 138#ifdef CONFIG_BATMAN_ADV_DEBUG
139int debug_log(struct bat_priv *bat_priv, char *fmt, ...) __printf(2, 3); 139int 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)
149static inline void bat_dbg(char type __always_unused, 149static 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 */
176static inline int compare_eth(void *data1, void *data2) 176
177static 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_ */