提交 e0df7e1f 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: avoid "spaces required around that ':'" false positive

Since commit 1f65f947 ("checkpatch: add checks for question mark and
colon spacing") back in 2008, checkpatch has reported false positive for
asm volatile uses of "::" checkpatch thinks colons should always have
spaces around it.

Add an exception for colons with colons on either side for this valid asm
volatile (and c++) use.
Signed-off-by: NJoe Perches <joe@perches.com>
Reported-by: NYehuda Yitschak <yehuday@marvell.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 323b267f
......@@ -3845,6 +3845,14 @@ sub process {
$ok = 1;
}
# for asm volatile statements
# ignore a colon with another
# colon immediately before or after
if (($op eq ':') &&
($ca =~ /:$/ || $cc =~ /^:/)) {
$ok = 1;
}
# messages are ERROR, but ?: are CHK
if ($ok == 0) {
my $msg_type = \&ERROR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册