From patchwork Sat May 12 09:28:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 912394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40jhcW4tGDz9ryk for ; Sat, 12 May 2018 19:34:19 +1000 (AEST) Received: from localhost ([::1]:60211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHQuv-0004vI-B9 for incoming@patchwork.ozlabs.org; Sat, 12 May 2018 05:34:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHQqj-0006CR-Le for qemu-devel@nongnu.org; Sat, 12 May 2018 05:29:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHQqi-0000nr-Pi for qemu-devel@nongnu.org; Sat, 12 May 2018 05:29:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50418 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fHQqg-0000mZ-Hd; Sat, 12 May 2018 05:29:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E84CE4480; Sat, 12 May 2018 09:29:54 +0000 (UTC) Received: from localhost (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EE6E215CDA7; Sat, 12 May 2018 09:29:53 +0000 (UTC) From: Stefan Hajnoczi To: Date: Sat, 12 May 2018 10:28:20 +0100 Message-Id: <20180512092824.13848-5-stefanha@redhat.com> In-Reply-To: <20180512092824.13848-1-stefanha@redhat.com> References: <20180512092824.13848-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 12 May 2018 09:29:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 12 May 2018 09:29:54 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 4/8] checkpatch: ignore email headers better X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Joe Perches There are some patches created by git format-patch that when scanned by checkpatch report errors on lines like To: address.tld This is a checkpatch false positive. Improve the logic a bit to ignore folded email headers to avoid emitting these messages. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Reviewed-by: Markus Armbruster Reviewed-by: Thomas Huth Signed-off-by: Stefan Hajnoczi Message-id: 20180430124651.10340-4-stefanha@redhat.com (cherry picked from commit 29ee1b0c67e0dd7dea8dd718e8326076bce5b6fe) Signed-off-by: Stefan Hajnoczi Reviewed-by: Thomas Huth Signed-off-by: Stefan Hajnoczi --- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 25bf43bad0..20d5b62586 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1183,7 +1183,7 @@ sub process { my $signoff = 0; my $is_patch = 0; - my $in_header_lines = 1; + my $in_header_lines = $file ? 0 : 1; my $in_commit_log = 0; #Scanning lines before patch my $non_utf8_charset = 0; @@ -1411,7 +1411,8 @@ sub process { # Check if it's the start of a commit log # (not a header line and we haven't seen the patch filename) if ($in_header_lines && $realfile =~ /^$/ && - $rawline !~ /^(commit\b|from\b|\w+:).+$/i) { + !($rawline =~ /^\s+\S/ || + $rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) { $in_header_lines = 0; $in_commit_log = 1; }