check_kernel_printf.c: Allow const char[] format arguments
commit69e38336b1b16300300eccc81b432b3437d90f0b
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Wed, 11 Feb 2015 21:20:38 +0000 (11 22:20 +0100)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 12 Feb 2015 20:43:23 +0000 (12 23:43 +0300)
treef27716eb88c2d53a0e604e920dbb9fe1ba33cda0
parentb267c9cd1516dd349e3891f22198dd076723d22e
check_kernel_printf.c: Allow const char[] format arguments

If the format argument is a const char[] with a literal initializer we
might as well do the checking also in that case (gcc also does
that). Similarly if the format argument is const char* const (gcc
apparently does not do that). This removes around 100 messages from an
allmodconfig, and of course provides coverage of those same call
sites.

In most cases, however, I think it would be more appropriate to insert
the format string directly where it is used. The linker merges
identical string constants, so there's nothing saved by using an array
variable (on the contrary, this wastes a little space on the variable
name itself), and it is easier for a human to immediately verify that
everything is ok, instead of having to search back through the file to
see how foo is defined.
check_kernel_printf.c