checkpatch: allow open braces on typedef lines
The style here seems to be split according to the maintainer, but traditionally open braces were placed on typedef lines. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
32857f4d5e
commit
5b90612952
@ -1704,11 +1704,6 @@ sub process {
|
|||||||
ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
|
ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ... however, open braces on typedef lines should be avoided.
|
|
||||||
if ($line =~ /^.\s*typedef\s+(enum|union|struct)(?:\s+$Ident\b)?.*[^;]$/) {
|
|
||||||
ERROR("typedefs should be separate from struct declaration\n" . $herecurr);
|
|
||||||
}
|
|
||||||
|
|
||||||
# missing space after union, struct or enum definition
|
# missing space after union, struct or enum definition
|
||||||
if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) {
|
if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) {
|
||||||
ERROR("missing space after $1 definition\n" . $herecurr);
|
ERROR("missing space after $1 definition\n" . $herecurr);
|
||||||
|
Loading…
Reference in New Issue
Block a user