* [PATCH] checkpatch: remove false positive for space before )
@ 2025-11-18 7:51 Artur Stupa
0 siblings, 0 replies; only message in thread
From: Artur Stupa @ 2025-11-18 7:51 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches
Cc: Dwaipayan Ray, Lukas Bulwahn, linux-kernel, Artur Stupa,
Andy Shevchenko
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-18 7:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 7:51 [PATCH] checkpatch: remove false positive for space before ) Artur Stupa
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.