The following commit has been merged in the master branch: commit 4560a6550c3613479e32a0c8816341b55a382967 Author: Sven Eckelmann sven@narfation.org Date: Sat May 14 23:14:46 2011 +0200
batman-adv: Annotate functions with format strings
Signed-off-by: Sven Eckelmann sven@narfation.org
diff --git a/bat_debugfs.c b/bat_debugfs.c index abaeec5..4577d3f 100644 --- a/bat_debugfs.c +++ b/bat_debugfs.c @@ -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; diff --git a/main.h b/main.h index 3ca3941..f80954b 100644 --- a/main.h +++ b/main.h @@ -138,7 +138,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 { \ @@ -147,6 +147,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, ...)