diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c1e7fb3eab44..2ec5fc6a4046 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -1869,6 +1869,18 @@ sub process { | |||
| 1869 | $herecurr); | 1869 | $herecurr); |
| 1870 | } | 1870 | } |
| 1871 | 1871 | ||
| 1872 | # check for static const char * arrays. | ||
| 1873 | if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) { | ||
| 1874 | WARN("static const char * array should probably be static const char * const\n" . | ||
| 1875 | $herecurr); | ||
| 1876 | } | ||
| 1877 | |||
| 1878 | # check for static char foo[] = "bar" declarations. | ||
| 1879 | if ($line =~ /\bstatic\s+char\s+(\w+)\s*\[\s*\]\s*=\s*"/) { | ||
| 1880 | WARN("static char array declaration should probably be static const char\n" . | ||
| 1881 | $herecurr); | ||
| 1882 | } | ||
| 1883 | |||
| 1872 | # check for new typedefs, only function parameters and sparse annotations | 1884 | # check for new typedefs, only function parameters and sparse annotations |
| 1873 | # make sense. | 1885 | # make sense. |
| 1874 | if ($line =~ /\btypedef\s/ && | 1886 | if ($line =~ /\btypedef\s/ && |
