lkml.org 
[lkml]   [2018]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[BUG] checkpatch.pl: false positive: space prohibited before open square bracket
Date
This patch leads to errors "space prohibited before open square
bracket '['" for the asm statement.

In the inline assembler statement the bracket is not used for an index.
Adding a space after a colon or a comma should be allowable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
foo.c | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 foo.c

diff --git a/foo.c b/foo.c
new file mode 100644
index 000000000000..7f0ed923f997
--- /dev/null
+++ b/foo.c
@@ -0,0 +1,11 @@
+static inline u32 deref(u32 *addr)
+{
+ int ret;
+
+ asm(
+ "ldr %[out], [%[in]]\n\t"
+ : [out] "=r" (ret)
+ : [in] "r" (addr)
+ );
+ return ret;
+}
--
2.16.3
\
 
 \ /
  Last update: 2018-04-03 21:03    [W:0.041 / U:2.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site