All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [BUG] checkpatch.pl: false positive: space prohibited before open square bracket
Date: Tue,  3 Apr 2018 21:02:14 +0200	[thread overview]
Message-ID: <20180403190214.23082-1-xypron.glpk@gmx.de> (raw)

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

             reply	other threads:[~2018-04-03 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 19:02 Heinrich Schuchardt [this message]
2018-04-03 19:16 ` [PATCH 1/1] checkpatch: allow space between colon and bracket Heinrich Schuchardt
2018-04-03 21:20   ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180403190214.23082-1-xypron.glpk@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.