[1/9] batman-adv: Annotate functions with format strings
Commit Message
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
bat_debugfs.c | 1 +
main.h | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
Comments
Hi Sven
Nice set of patches.
Are you using any tools to find these issues? I don't think sparse
points these out.
Thanks
Andrew
Andrew Lunn wrote:
> Nice set of patches.
>
> Are you using any tools to find these issues? I don't think sparse
> points these out.
I read the linux kernel mailinglist and found a mail where batman-ad was
mentioned [1] - nothing to be proud of. So I started to look around and found
something here and there... at the end I had bleeding eyes and 9 patches (yes,
there are ten because I did a break and noticed too late that I wanted to add
the sparse/lockdep annotation for the RCU update-side since a while).
Kind regards,
Sven
[1] http://thread.gmane.org/gmane.linux.kernel/1139857
On Saturday 14 May 2011 23:14:46 Sven Eckelmann wrote:
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> bat_debugfs.c | 1 +
> main.h | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletions(-)
Applied in revision 4560a65.
Thanks,
Marek
On Sunday 15 May 2011 09:27:57 Sven Eckelmann wrote:
> I read the linux kernel mailinglist and found a mail where batman-ad was
> mentioned [1] - nothing to be proud of. So I started to look around and
> found something here and there... at the end I had bleeding eyes and 9
> patches (yes, there are ten because I did a break and noticed too late
> that I wanted to add the sparse/lockdep annotation for the RCU update-side
> since a while).
Please find somebody that can take a picture of you next time. I'd like to
prepare a picture gallery of all the people who suffer to make batman-adv
somewhat usable. :-)
Thanks,
Marek
@@ -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;
@@ -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, ...)