Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1039268yba; Sat, 20 Apr 2019 20:29:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9JATEGJYAE+cFgbPzZn04KJaPMN6Oxod7dmTzMLHvmEqs3HJNQkc2X08BcGgEAIlnLHV0 X-Received: by 2002:aa7:8092:: with SMTP id v18mr12892582pff.35.1555817356988; Sat, 20 Apr 2019 20:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555817356; cv=none; d=google.com; s=arc-20160816; b=LlMao6zzAIVEL+DzXZFyRSYivPoXupRfKbzPawUyZ4WO7C49UtmoNB3xJ3/87BtGnh rSGi+5+Hut8EXHqQRFpan4JROwtw3rla2NhsfSkLlP/M6VolG7VuLe6c2ZM8/HrSyXSS WjTBrH7cx4+1EchPMMowrmBF7QjYOyvQugzriKwUtVVbYr71RmHp8JY/tJlpeTupEDGc ir4I/5zX39gWTwH84fonB9MyRt8ZMQMllQOmgWMehwLg1Xh+qbrTf8nQloAsFlhwEgNU u88YA7/1Dv0/7OvXj1n/IzPKJHpqmflSoggUFLdMMjxdUF9aSKQVYxia1OWCUYscnRFW yZQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date; bh=xD3KxZlvFfB14T1VBFRzqVJ5ggZBURo3AuUV61L6Z2A=; b=loiKN6pRM+871MXdrXOMDb/68UIjlVSnMQBgiViEr8JQbp9UBlaefk4l0yJTnX+GZJ 8b4vqIr+sPl4kBaXijmeiTyr84pvpnU5ze5ZO2dcJgjJUd+jdX2wi1+v1y+GAjLDJRvh 5NOz+RlrUrMKjTBgr/kNNnbOeaiD0i4oYva1UvNtxIRtYh4zzxJgYHgcoCyE/4i8VaP4 AiFHbBu08jwLhOoerXoayFr/oyMAZ6XefDWdJkB/t7V55P1Pd6rK5MNq4DV8FgipzDkI c4am7FnpzGAVXkC6UTEdEaX5Zkx7UacOVyUrvKHfAD93HrUSIyBozzVVyOpS7X5OPnCk 12Dw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si8687809pgu.546.2019.04.20.20.28.50; Sat, 20 Apr 2019 20:29:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbfDUD0F (ORCPT + 99 others); Sat, 20 Apr 2019 23:26:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfDUD0E (ORCPT ); Sat, 20 Apr 2019 23:26:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B41A485543; Sun, 21 Apr 2019 03:26:04 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-33.pek2.redhat.com [10.72.12.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7084819C4F; Sun, 21 Apr 2019 03:26:01 +0000 (UTC) Date: Sun, 21 Apr 2019 11:25:57 +0800 From: Dave Young To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Subject: [PATCH] checkpatch: mute SOB warning in case SOB exists but without From header Message-ID: <20190421032557.GA9025@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 21 Apr 2019 03:26:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org checkpatch.pl report below warning but the SOB line is correct: $ ./scripts/checkpatch.pl patches/test.patch WARNING: Missing Signed-off-by: line by nominal patch author '' Actually checkpatch.pl assumes every patch includes "From:" line, this is true for a git formated patch, some saved mail format patch. But the warning is boring for people who do not use git formated patch. Change the script only print warning in case "From:" line exists. Signed-off-by: Dave Young --- scripts/checkpatch.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- linux-x86.orig/scripts/checkpatch.pl +++ linux-x86/scripts/checkpatch.pl @@ -2283,7 +2283,7 @@ sub process { our $clean = 1; my $signoff = 0; my $author = ''; - my $authorsignoff = 0; + my $authorsignoff = -1; my $is_patch = 0; my $is_binding_patch = -1; my $in_header_lines = $file ? 0 : 1; @@ -2609,6 +2609,8 @@ sub process { $l =~ s/"//g; if ($l =~ /^\s*signed-off-by:\s*\Q$author\E/i) { $authorsignoff = 1; + } else { + $authorsignoff = 0; } } } @@ -6649,7 +6651,7 @@ sub process { if ($signoff == 0) { ERROR("MISSING_SIGN_OFF", "Missing Signed-off-by: line(s)\n"); - } elsif (!$authorsignoff) { + } elsif ($authorsignoff == 0) { WARN("NO_AUTHOR_SIGN_OFF", "Missing Signed-off-by: line by nominal patch author '$author'\n"); }