aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-12 07:48:58 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-25 02:21:30 -0400
commit1eda58bfc56c43e73a0cf2bfb6e4d620ab866109 (patch)
treed71ba63d988193126831e49bdce03a1131d28ea4 /net/batman-adv/main.h
parentf0530ee5fb9e73465ac844ada2c96a2bea85a18f (diff)
batman-adv: Prefix main static inline functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 4b06b7621e7a..28242642c3f1 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -175,7 +175,7 @@ int batadv_algo_seq_print_text(struct seq_file *seq, void *offset);
175int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...) 175int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...)
176__printf(2, 3); 176__printf(2, 3);
177 177
178#define bat_dbg(type, bat_priv, fmt, arg...) \ 178#define batadv_dbg(type, bat_priv, fmt, arg...) \
179 do { \ 179 do { \
180 if (atomic_read(&bat_priv->log_level) & type) \ 180 if (atomic_read(&bat_priv->log_level) & type) \
181 batadv_debug_log(bat_priv, fmt, ## arg);\ 181 batadv_debug_log(bat_priv, fmt, ## arg);\
@@ -183,9 +183,9 @@ __printf(2, 3);
183 while (0) 183 while (0)
184#else /* !CONFIG_BATMAN_ADV_DEBUG */ 184#else /* !CONFIG_BATMAN_ADV_DEBUG */
185__printf(3, 4) 185__printf(3, 4)
186static inline void bat_dbg(int type __always_unused, 186static inline void batadv_dbg(int type __always_unused,
187 struct bat_priv *bat_priv __always_unused, 187 struct bat_priv *bat_priv __always_unused,
188 const char *fmt __always_unused, ...) 188 const char *fmt __always_unused, ...)
189{ 189{
190} 190}
191#endif 191#endif
@@ -194,14 +194,14 @@ static inline void bat_dbg(int type __always_unused,
194 do { \ 194 do { \
195 struct net_device *_netdev = (net_dev); \ 195 struct net_device *_netdev = (net_dev); \
196 struct bat_priv *_batpriv = netdev_priv(_netdev); \ 196 struct bat_priv *_batpriv = netdev_priv(_netdev); \
197 bat_dbg(DBG_ALL, _batpriv, fmt, ## arg); \ 197 batadv_dbg(DBG_ALL, _batpriv, fmt, ## arg); \
198 pr_info("%s: " fmt, _netdev->name, ## arg); \ 198 pr_info("%s: " fmt, _netdev->name, ## arg); \
199 } while (0) 199 } while (0)
200#define bat_err(net_dev, fmt, arg...) \ 200#define bat_err(net_dev, fmt, arg...) \
201 do { \ 201 do { \
202 struct net_device *_netdev = (net_dev); \ 202 struct net_device *_netdev = (net_dev); \
203 struct bat_priv *_batpriv = netdev_priv(_netdev); \ 203 struct bat_priv *_batpriv = netdev_priv(_netdev); \
204 bat_dbg(DBG_ALL, _batpriv, fmt, ## arg); \ 204 batadv_dbg(DBG_ALL, _batpriv, fmt, ## arg); \
205 pr_err("%s: " fmt, _netdev->name, ## arg); \ 205 pr_err("%s: " fmt, _netdev->name, ## arg); \
206 } while (0) 206 } while (0)
207 207
@@ -209,7 +209,7 @@ static inline void bat_dbg(int type __always_unused,
209 * 209 *
210 * note: can't use compare_ether_addr() as it requires aligned memory 210 * note: can't use compare_ether_addr() as it requires aligned memory
211 */ 211 */
212static inline int compare_eth(const void *data1, const void *data2) 212static inline int batadv_compare_eth(const void *data1, const void *data2)
213{ 213{
214 return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); 214 return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
215} 215}
@@ -220,7 +220,8 @@ static inline int compare_eth(const void *data1, const void *data2)
220 * 220 *
221 * Returns true if current time is after timestamp + timeout 221 * Returns true if current time is after timestamp + timeout
222 */ 222 */
223static inline bool has_timed_out(unsigned long timestamp, unsigned int timeout) 223static inline bool batadv_has_timed_out(unsigned long timestamp,
224 unsigned int timeout)
224{ 225{
225 return time_is_before_jiffies(timestamp + msecs_to_jiffies(timeout)); 226 return time_is_before_jiffies(timestamp + msecs_to_jiffies(timeout));
226} 227}