diff options
-rwxr-xr-x | scripts/checkpatch.pl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bcdb54bd61a0..983ac1816da0 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1905,6 +1905,16 @@ sub process { | |||
1905 | ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr); | 1905 | ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr); |
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | # missing space after union or struct definition | ||
1909 | if ($rawline =~ /^\+\s*(union|struct)\s+$Ident[=\{]/) { | ||
1910 | WARN("Missing space after struct or union definition\n" . $herecurr); | ||
1911 | } | ||
1912 | |||
1913 | # missing space after enum definition | ||
1914 | if ($rawline =~ /^\+\s*enum\{/) { | ||
1915 | WARN("Missing space after enum definition\n" . $herecurr); | ||
1916 | } | ||
1917 | |||
1908 | # open braces for enum, union and struct go on the same line. | 1918 | # open braces for enum, union and struct go on the same line. |
1909 | if ($line =~ /^.\s*{/ && | 1919 | if ($line =~ /^.\s*{/ && |
1910 | $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { | 1920 | $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { |