diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5e3f4191f9596629cb1c72eddc4f313c9aeb8691..ba7bcf34ad01e6bdf1b5f20371782c421ec7d717 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2815,7 +2815,7 @@ sub process {
 			# Flatten any parentheses and braces
 			while ($dstat =~ s/\([^\(\)]*\)/1/ ||
 			       $dstat =~ s/\{[^\{\}]*\}/1/ ||
-			       $dstat =~ s/\[[^\{\}]*\]/1/)
+			       $dstat =~ s/\[[^\[\]]*\]/1/)
 			{
 			}