From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932709AbeAKVBX (ORCPT + 1 other); Thu, 11 Jan 2018 16:01:23 -0500 Received: from smtprelay0225.hostedemail.com ([216.40.44.225]:39843 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932290AbeAKVBW (ORCPT ); Thu, 11 Jan 2018 16:01:22 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: woman61_45f690e9faf1b X-Filterd-Recvd-Size: 1681 Message-ID: <1515704479.9619.171.camel@perches.com> Subject: checkpatch: Avoid some false positives for TABSTOP declaration test From: Joe Perches To: Andrew Morton Cc: LKML , Sven Eckelmann Date: Thu, 11 Jan 2018 13:01:19 -0800 Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Using an open bracket after what seems to be a declaration can also be a function definition and declaration argument line continuation so remove the open bracket from the possible declaration/definition matching. e.g.: int foobar(int a; int *b[]); Signed-off-by: Joe Perches Reported-by: Sven Eckelmann --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d2464058ab5d..294f03fe25ea 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3020,7 +3020,7 @@ sub process { # check indentation starts on a tab stop if ($^V && $^V ge 5.10.0 && - $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=\[])/) { + $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) { my $indent = length($1); if ($indent % 8) { if (WARN("TABSTOP",