[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251118075207.29233-1-arthur.stupa@gmail.com>
Date: Mon, 17 Nov 2025 23:51:44 -0800
From: Artur Stupa <arthur.stupa@...il.com>
To: Andy Whitcroft <apw@...onical.com>,
Joe Perches <joe@...ches.com>
Cc: Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
linux-kernel@...r.kernel.org,
Artur Stupa <arthur.stupa@...il.com>,
Andy Shevchenko <andriy.shevchenko@...el.com>
Subject: [PATCH] checkpatch: remove false positive for space before )
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@...el.com>
Link: https://lore.kernel.org/all/20250919212938.822374-1-deepanshu.pratik@gmail.com/T/#r517c63044278051aa381f7d17d1da2700e079d94
Signed-off-by: Artur Stupa <arthur.stupa@...il.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
Powered by blists - more mailing lists