From: Artur Stupa <arthur.stupa@gmail.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
linux-kernel@vger.kernel.org,
Artur Stupa <arthur.stupa@gmail.com>,
Andy Shevchenko <andriy.shevchenko@intel.com>
Subject: [PATCH] checkpatch: remove false positive for space before )
Date: Mon, 17 Nov 2025 23:51:44 -0800 [thread overview]
Message-ID: <20251118075207.29233-1-arthur.stupa@gmail.com> (raw)
checkpatch reports the following error when a macro ends with a
comma and a space:
ERROR: space prohibited before that close parenthesis ')'
This patch adds the condition "$line !~ /,\s+\)/" to avoid such cases,
following the similar rule above "$line !~ /:\s+\)/".
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/all/20250919212938.822374-1-deepanshu.pratik@gmail.com/T/#r517c63044278051aa381f7d17d1da2700e079d94
Signed-off-by: Artur Stupa <arthur.stupa@gmail.com>
---
scripts/checkpatch.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 92669904eecc..00ee9258ab40 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5494,7 +5494,8 @@ sub process {
}
if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
$line !~ /for\s*\(.*;\s+\)/ &&
- $line !~ /:\s+\)/) {
+ $line !~ /:\s+\)/ &&
+ $line !~ /,\s+\)/) {
if (ERROR("SPACING",
"space prohibited before that close parenthesis ')'\n" . $herecurr) &&
$fix) {
--
2.43.0
reply other threads:[~2025-11-18 7:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20251118075207.29233-1-arthur.stupa@gmail.com \
--to=arthur.stupa@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®