[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1289909596-7317-1-git-send-email-dave.martin@linaro.org>
Date: Tue, 16 Nov 2010 12:13:16 +0000
From: Dave Martin <dave.martin@...aro.org>
To: linux-kernel@...r.kernel.org
Cc: Dave Martin <dave.martin@...aro.org>,
Andy Whitcroft <apw@...onical.com>
Subject: [PATCH] checkpatch: Allow space before [ in the case of inline asm constraints
This allows the customary syntax for declaring named arguments,
such as:
asm ("mov %[out],%[in]" : [out] "=r" (x) : [in] "r" (y));
Since :[ is comple-error-inducingly invalid syntax in other cases,
this won't create unintentional leniency for normal uses of [
Signed-off-by: Dave Martin <dave.martin@...aro.org>
---
scripts/checkpatch.pl | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e3c7fc0..2c2fa51 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1988,11 +1988,13 @@ sub process {
# 1. with a type on the left -- int [] a;
# 2. at the beginning of a line for slice initialisers -- [0...10] = 5,
# 3. inside a curly brace -- = { [0...10] = 5 }
+# 4. after a colon for inline asm -- asm ("..." : [name] "constraint" (arg))
while ($line =~ /(.*?\s)\[/g) {
my ($where, $prefix) = ($-[1], $1);
if ($prefix !~ /$Type\s+$/ &&
($where != 0 || $prefix !~ /^.\s+$/) &&
- $prefix !~ /{\s+$/) {
+ $prefix !~ /{\s+$/ &&
+ $prefix !~ /:\s+$/) {
ERROR("space prohibited before open square bracket '['\n" . $herecurr);
}
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists