]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: warn on const char foo[] = "bar"; declarations
authorJoe Perches <joe@perches.com>
Thu, 3 Jan 2019 23:26:59 +0000 (15:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Jan 2019 21:13:46 +0000 (13:13 -0800)
commit1b541f2435ccf3662866a841216f200c577d5fbb
tree6c330016a11944d5dd5f9f0dd5b5e7651e1b35ae
parent72028081b84258e3cad9821ac84add1d12c22211
checkpatch: warn on const char foo[] = "bar"; declarations

These declarations should generally be static const to avoid poor
compilation and runtime performance where compilers tend to initialize
the const declaration for every call instead of using .rodata for the
string.

Miscellanea:

 - Convert spaces to tabs for indentation in 2 adjacent checks

Link: http://lkml.kernel.org/r/10ea5f4b087dc911e41e187a4a2b5e79c7529aa3.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl