batman-adv: Annotate functions with format strings
authorSven Eckelmann <sven@narfation.org>
Sat, 14 May 2011 21:14:46 +0000 (23:14 +0200)
committerSven Eckelmann <sven@narfation.org>
Mon, 30 May 2011 05:39:29 +0000 (07:39 +0200)
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/bat_debugfs.c
net/batman-adv/main.h

index abaeec5f6247dc8e486bb9bb1b0511551984fff2..4577d3fe9940925d346ca72add919896958bc457 100644 (file)
@@ -50,6 +50,7 @@ static void emit_log_char(struct debug_log *debug_log, char c)
                debug_log->log_start = debug_log->log_end - log_buff_len;
 }
 
+__printf(2, 3)
 static int fdebug_log(struct debug_log *debug_log, char *fmt, ...)
 {
        va_list args;
index 148b49e0264259e9bcbfd25625a262a251d75628..ba28436bcdd6379c0e20fbca2b6fea67b8b64e0c 100644 (file)
@@ -136,7 +136,7 @@ void dec_module_count(void);
 int is_my_mac(uint8_t *addr);
 
 #ifdef CONFIG_BATMAN_ADV_DEBUG
-int debug_log(struct bat_priv *bat_priv, char *fmt, ...);
+int debug_log(struct bat_priv *bat_priv, char *fmt, ...) __printf(2, 3);
 
 #define bat_dbg(type, bat_priv, fmt, arg...)                   \
        do {                                                    \
@@ -145,6 +145,7 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...);
        }                                                       \
        while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
+__printf(3, 4)
 static inline void bat_dbg(char type __always_unused,
                           struct bat_priv *bat_priv __always_unused,
                           char *fmt __always_unused, ...)