coredump: add __printf attribute to cn_*printf functions
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Thu, 25 Jun 2015 22:03:53 +0000 (15:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Jun 2015 00:00:43 +0000 (17:00 -0700)
commitb4176b7c135ed28e78752552358919e5b14ad2bf
tree09f9c9431b7fd0dee8fca86f75cb211132ae648c
parent5202efe544c279be152f44f2821010ff7b2d7e5b
coredump: add __printf attribute to cn_*printf functions

This allows detecting improper format string at build time, like:

  fs/coredump.c:225:5: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
       err = cn_printf(cn, "%ld", cprm->siginfo->si_signo);
       ^

As si_signo is always an int, the format should be %d here.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/coredump.c