[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH correct] checkpatch: allow space in more places befo
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH correct] checkpatch: allow space in more places before a bracket |
Date: |
Fri, 17 Aug 2018 12:51:57 +0200 |
From: Heinrich Schuchardt <address@hidden>
Allow a space between a colon and subsequent opening bracket. This
sequence may occur in inline assembler statements like
asm(
"ldr %[out], [%[in]]\n\t"
: [out] "=r" (ret)
: [in] "r" (addr)
);
Allow a space between a comma and subsequent opening bracket. This
sequence may occur in designated initializers.
To ease backporting the patch, I am also changing the comma-bracket
detection (added in QEMU by commit 409db6eb7199af7a2f09f746bd1b793e9daefe5f)
to use the same regex as brackets and colons (as done independently
by Linux commit daebc534ac15f991961a5bb433e515988220e9bf).
Link: http://lkml.kernel.org/r/address@hidden
Signed-off-by: Heinrich Schuchardt <address@hidden>
Acked-by: Joe Perches <address@hidden>
Signed-off-by: Andrew Morton <address@hidden>
Signed-off-by: Linus Torvalds <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/checkpatch.pl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 52ab18bfce..33b5771120 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1977,9 +1977,8 @@ sub process {
my ($where, $prefix) = ($-[1], $1);
if ($prefix !~ /$Type\s+$/ &&
($where != 0 || $prefix !~ /^.\s+$/) &&
- $prefix !~ /{\s+$/ &&
$prefix !~ /\#\s*define[^(]*\([^)]*\)\s+$/ &&
- $prefix !~ /,\s+$/) {
+ $prefix !~ /[,{:]\s+$/) {
ERROR("space prohibited before open square
bracket '['\n" . $herecurr);
}
}
--
2.17.1
- [Qemu-devel] [PATCH correct] checkpatch: allow space in more places before a bracket,
Paolo Bonzini <=