]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kernel/panic.c: reduce 1 byte usage for print tainted buffer
authorChen Gang <gang.chen@asianux.com>
Tue, 5 Nov 2013 05:57:44 +0000 (16:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:57:44 +0000 (16:57 +1100)
sizeof("Tainted: ") already counts '\0', and after first sprintf(), 's'
will start from the current string end (its' value is '\0').

So need not add additional 1 byte for maximized usage of 'buf' in
print_tainted().

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/panic.c

index b6c482ccc5db77f4af0afbb0948ff0373bb094d5..c00b4ceb39e8b151aab790e6b498247ea53a4aa6 100644 (file)
@@ -233,7 +233,7 @@ static const struct tnt tnts[] = {
  */
 const char *print_tainted(void)
 {
-       static char buf[ARRAY_SIZE(tnts) + sizeof("Tainted: ") + 1];
+       static char buf[ARRAY_SIZE(tnts) + sizeof("Tainted: ")];
 
        if (tainted_mask) {
                char *s;