All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: fix for stripping brackets from macros.
@ 2017-12-18 14:17 Jeremy Sowden
  2017-12-18 15:12 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Sowden @ 2017-12-18 14:17 UTC (permalink / raw)
  To: linux-kernel, joe, apw; +Cc: Jeremy Sowden

When checking macros, checkpatch.pl strips parentheses, square brackets
and braces.  However, the search-and-replace expression was not correct,
and instead of replacing the brackets and their contents with just the
contents, it was replacing them with literal 1's.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 scripts/checkpatch.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 168687ae24fa..3b67646df845 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4874,9 +4874,9 @@ sub process {
 			$dstat =~ s/\s*$//s;
 
 			# Flatten any parentheses and braces
-			while ($dstat =~ s/\([^\(\)]*\)/1/ ||
-			       $dstat =~ s/\{[^\{\}]*\}/1/ ||
-			       $dstat =~ s/.\[[^\[\]]*\]/1/)
+			while ($dstat =~ s/\(([^\(\)]*)\)/$1/ ||
+			       $dstat =~ s/\{([^\{\}]*)\}/$1/ ||
+			       $dstat =~ s/.\[([^\[\]]*)\]/$1/)
 			{
 			}
 

base-commit: 53600ecfb6004f355bd3551bee180caf4b42d7a7
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-18 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18 14:17 [PATCH] checkpatch: fix for stripping brackets from macros Jeremy Sowden
2017-12-18 15:12 ` Joe Perches
2017-12-18 16:23   ` Jeremy Sowden

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.