]> 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)
commitc5206562ace7a291a32d707720913f8d300c2f16
tree6c330016a11944d5dd5f9f0dd5b5e7651e1b35ae
parente835b495e74a2365a1ef837b3f2b22d56e7e1f1f
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