Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754210AbZJPSkG (ORCPT ); Fri, 16 Oct 2009 14:40:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754092AbZJPSkD (ORCPT ); Fri, 16 Oct 2009 14:40:03 -0400 Received: from adelie.canonical.com ([91.189.90.139]:53020 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753591AbZJPSj7 (ORCPT ); Fri, 16 Oct 2009 14:39:59 -0400 From: Andy Whitcroft To: Andrew Morton Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Andy Whitcroft Subject: [PATCH 2/7] checkpatch: correctly stop scanning at the bottom of a hunk Date: Fri, 16 Oct 2009 19:39:27 +0100 Message-Id: <1255718372-22805-3-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1255718372-22805-1-git-send-email-apw@canonical.com> References: <1255718372-22805-1-git-send-email-apw@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1310 Lines: 39 We are allowing context scanning checks to apply against the first line of context outside at the end of the hunk. This can lead to false matches to patch names leading to various perl warnings. Correctly stop at the bottom of the hunk. Signed-off-by: Andy Whitcroft --- scripts/checkpatch.pl | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b43e309..1eca1e1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1234,7 +1234,6 @@ sub process { $linenr++; my $rawline = $rawlines[$linenr - 1]; - my $hunk_line = ($realcnt != 0); #extract the line range in the file after the patch is applied if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { @@ -1274,6 +1273,8 @@ sub process { $realcnt--; } + my $hunk_line = ($realcnt != 0); + #make up the handle for any error we report on this line $prefix = "$filename:$realline: " if ($emacs && $file); $prefix = "$filename:$linenr: " if ($emacs && !$file); -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/