Received: by 10.213.65.68 with SMTP id h4csp2433980imn; Mon, 2 Apr 2018 07:31:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++aC0RnyH4REbEaM1LfHjOkeUgD7odDeWdGPVVnYgs6GObSbp7/7gYnK+FRF8F5zIFukPn X-Received: by 10.99.127.89 with SMTP id p25mr6507690pgn.293.1522679490090; Mon, 02 Apr 2018 07:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522679490; cv=none; d=google.com; s=arc-20160816; b=PZtUDLCTOKu2FQ8a24C6aV3gvaRGjFhKOGSesdv7Xd7EHPm9T39GO2LrthW5hBDy3a 7OQTiR/79R2gQaEqfj6LA/yOJo0pou91n4XWZ0yk8rJyNkvkHMQk9KRtqayURJHN1VDV wEq0FJoKLdqfFDPKmUyqUoSrZvsa2/Fs/49wG2bYJ5yiVopt+bQGK1KHUgeg6GxXCfIg XlY+LXrbEg/OtZ6nLtP04RGb5eWEmj7ey7wbMvvGUxVjKjiylNTWv3zGsZZ8bFPCptaB 3seRX18a19NNQ4GAgsCaEJsiTc3TUH+WRtBTSquUwdlkwofyGMwKR8Glh6K13oIcGMRw xBkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=z2dLfdAZCN9a0QiKVYdn5sK35TbZO+wXuqewO9t3KfI=; b=F7Dnx0+DDk/mk1hKAwWOfQRkmBBUEfk4p7j3X4fGTnqKjT2NCiH1fl8yUD9KqNJFvu /tawlSkT1jA7YibFwXTgbKOvLEEO3Y14gIK2j+ShxZ1XnS/T+UzGU2j2TBVPD6hi1jIy JXtjLjBwCpWR84yQc3X4AFXCz6FqEFtqwnbXPQuejyMLyP6sd/RCjHHdy5PhpOWvoffi Bv+ZS+z9fnlHg1NrIw7PUbWAB+ZNkRQUgCCSjn3hihB4h00QxI1MugwTATjPx7fpmx+I lfxQDuf0U0npVP3/0Gedi6k2irSCd1377s9F9g6ctP1Cv9ycBui43CmTWaCBUCX9z7PL VQtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KCnoSmw4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si299706pgu.158.2018.04.02.07.31.16; Mon, 02 Apr 2018 07:31:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KCnoSmw4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752980AbeDBO3p (ORCPT + 99 others); Mon, 2 Apr 2018 10:29:45 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:36584 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752946AbeDBO3a (ORCPT ); Mon, 2 Apr 2018 10:29:30 -0400 Received: by mail-pl0-f68.google.com with SMTP id 91-v6so4326450pld.3 for ; Mon, 02 Apr 2018 07:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z2dLfdAZCN9a0QiKVYdn5sK35TbZO+wXuqewO9t3KfI=; b=KCnoSmw4PP+7bEcSgvysg/f9CVSFLQeepDJene2zlvjIP42YACCWp9vqVtgaCeeK68 3Jw8Rx2mKWQtWJKh9mAFhJOZxHmA8YvM1OvEsuSaPxT9+XPzmW/9oRh/5hLf+dwaBOEU Whn5awhKCmF5x6/7ntgexmwUFWMLZMKTN8XRTaPXQiaTjSjsSGX5o6ulRDmFHl0WVJtp PxQEppOt2xgdtlNKDhpJ0lcbQ0JUFO5psZyLPa41pPWEEXTckkUAJadsTlSCEDXItK1F aJlswBybQeVx2LVWPJqV7h0/WgJ+hsTFS2CZPPnvtZyySJ2kpBpsd9gBLyKTUBv9JyOI tOYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z2dLfdAZCN9a0QiKVYdn5sK35TbZO+wXuqewO9t3KfI=; b=WS07gzVtvjaU+gM6vJTm9uEaAWrNs7WdaHoUbwkapvNLcsil327OwnO+sxJLBaZuky QRnW04zYXPPo7CPJwpjSktUgCQsDK1Sk5+ZrNQrqPAGNPUSPwgZi9E5jAwYJW03B37K6 pP2E3J6XpdveLYd2Do4RPx3cb0at3uGZ61CqZ2/7Pg//RwQt40Yq0YRMHjziap5yrD51 ClvmfTrjhiRELfvwVwi4nL7AZSY9DwTaR/Io3xElaKGFRQ1OYJKWg9GHYWgy+tm7JlAy Hir/M73iC8EMLmcZ1KorB1iCN3HGEEnjNUTuVVc5Q08ekEyh3h5DJqwiMk7qeNKeipsg h6cA== X-Gm-Message-State: AElRT7Ev/ZjmofgdVtPQYP4/q6nzMKC+ikGlhX3Hzr/Rl/TLPmyedbOC 8D8GZ7VHe6eOljcVnxrCa9s= X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr9906809plk.32.1522679370343; Mon, 02 Apr 2018 07:29:30 -0700 (PDT) Received: from localhost.localdomain ([38.106.11.25]) by smtp.gmail.com with ESMTPSA id q17sm1194917pgt.7.2018.04.02.07.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Apr 2018 07:29:29 -0700 (PDT) From: Jia He To: Andy Whitcroft , Joe Perches Cc: linux-kernel@vger.kernel.org, Jia He , Jia He Subject: [PATCH] checkpatch: relax check for revert commit Date: Mon, 2 Apr 2018 07:28:59 -0700 Message-Id: <1522679339-19067-2-git-send-email-hejianet@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522679339-19067-1-git-send-email-hejianet@gmail.com> References: <1522679339-19067-1-git-send-email-hejianet@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For revert commit, it might has two double quotation marks in its commit log. Relax the check condition for revert commit to avoid checkpatch errors. Signed-off-by: Jia He --- scripts/checkpatch.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3d40403..96138d6 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2643,20 +2643,20 @@ sub process { $long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i); $space = 0 if ($line =~ /\bcommit [0-9a-f]/i); $case = 0 if ($line =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/); - if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)"\)/i) { + if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*)"\)/i) { $orig_desc = $1; $hasparens = 1; } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i && defined $rawlines[$linenr] && - $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) { + $rawlines[$linenr] =~ /^\s*\("(.*)"\)/) { $orig_desc = $1; $hasparens = 1; - } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i && - defined $rawlines[$linenr] && - $rawlines[$linenr] =~ /^\s*[^"]+"\)/) { - $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i; + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\(".*$/i && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^\s*.*"\)/) { + $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*)$/i; $orig_desc = $1; - $rawlines[$linenr] =~ /^\s*([^"]+)"\)/; + $rawlines[$linenr] =~ /^\s*(.*)"\)/; $orig_desc .= " " . $1; $hasparens = 1; } -- 2.7.4