From patchwork Fri Jan 20 12:35:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thorsten Leemhuis X-Patchwork-Id: 46317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp172830wrn; Fri, 20 Jan 2023 04:36:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXtBXnyxmt6KfqXHVvIX9wKIIDHmoz8K3a7ZZPUfv5ZsqFtJhpDv4bDhTC4qgXlPIhWp8Yks X-Received: by 2002:a17:907:a4c6:b0:86f:1283:7b1d with SMTP id vq6-20020a170907a4c600b0086f12837b1dmr2567540ejc.71.1674218203504; Fri, 20 Jan 2023 04:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674218203; cv=none; d=google.com; s=arc-20160816; b=NPKFDOm1yKUrgrknqXqPfXymtDA9U8fyth2HSqBWFH6voF5zrHroCYt8TuPZyyJldj UVTVmu03DDtdFyPgE2sHNi96uRaIueuDtDFu2Cphnq1C9vKj8e1y7BLFWJvnF1lWrzRr vNdByykcb/75uHagFD44IVRRGj95iwSWsiOjq/G07wRRsJHGMJ2edZXqaUQETWzzkA0A d0RF1VNKteLaSgFSrNPd2k5rOT0gaLcAevbB2f8oiTbeC9U9CBcDv1bBMEhUpLXy8toB WO3g9xQDvGPuw6LdfSyRGO8kqkdZAlF6+VNgE+FMu8/aKKaKLPN17mP2hCBAd3aa+QUS N7pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GHoWTMc2Io4mV0+tX3de1ddZQgVg8hoqdPQixXptV9w=; b=Egdpab9GnSkJsLrHmMEWAmQJU96e/S7pzguUjwl+y8kD6+VVdZu1UhmRXm2F0RQ/4T H+Xrenf7ra3/25y6DNM+/d7I4zFgGWjsHbObINyVsyfQPe2AAGs+J3GxjUjFZ1hb4dIL R5Uy0djkS50Uz8YHMPSMyoEN51CmsSiGgj7xcaBRl1rnWEQ5vuzRVawNZ4laNPaWq8iv lyHKKpx/xs0OYX7z3g8+Vn7rTO2Q8uxC2NSV/QqDQSGt/cxkliKhi/AyQLM2BZT/crdz Hkph9LpAOhi9CZpAcGqCSNbWehBEGQ0NopJMHqZk9c6+I/NWY+b2+MYxk+F8iPcsO+/g iNKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xd8-20020a170907078800b007c11805a849si43364929ejb.341.2023.01.20.04.36.19; Fri, 20 Jan 2023 04:36:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbjATMfo (ORCPT + 99 others); Fri, 20 Jan 2023 07:35:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbjATMfb (ORCPT ); Fri, 20 Jan 2023 07:35:31 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 144B4BD17F for ; Fri, 20 Jan 2023 04:35:24 -0800 (PST) Received: from ip4d14bd73.dynamic.kabel-deutschland.de ([77.20.189.115] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1pIqc5-0007pV-WF; Fri, 20 Jan 2023 13:35:22 +0100 From: Thorsten Leemhuis To: Joe Perches , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn Cc: =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] checkpatch: warn when unknown tags are used for links Date: Fri, 20 Jan 2023 13:35:18 +0100 Message-Id: <3b036087d80b8c0e07a46a1dbaaf4ad0d018f8d5.1674217480.git.linux@leemhuis.info> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1674218125;93060bd7; X-HE-SMSGID: 1pIqc5-0007pV-WF X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755545026953932543?= X-GMAIL-MSGID: =?utf-8?q?1755545026953932543?= From: Kai Wasserbäch Issue a warning when encountering URLs behind unknown tags, as Linus recently stated ```please stop making up random tags that make no sense. Just use "Link:"```[1]. That statement was triggered by an use of 'BugLink', but that's not the only tag people invented: $ git log -100000 --no-merges --format=email -P \ --grep='^\w+:[ \t]*http' | grep -Poh '^\w+:[ \t]*http' | \ sort | uniq -c | sort -rn | head -n 20 103958 Link: http 418 BugLink: http 372 Patchwork: http 280 Closes: http 224 Bug: http 123 References: http 84 Bugzilla: http 61 URL: http 42 v1: http 38 Datasheet: http 20 v2: http 9 Ref: http 9 Fixes: http 9 Buglink: http 8 v3: http 8 Reference: http 7 See: http 6 1: http 5 link: http 3 Link:http Some of these non-standard tags make it harder for external tools that rely on use of proper tags. One of those tools is the regression tracking bot 'regzbot', which looks out for "Link:" tags pointing to reports of tracked regressions. The initial idea was to use a disallow list to raise an error when encountering known unwanted tags like BugLink:; during review it was requested to use a list of allowed tags instead[2]. Link: https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/15f7df96d49082fb7799dda6e187b33c84f38831.camel@perches.com/ [2] Signed-off-by: Kai Wasserbäch Co-developed-by: Thorsten Leemhuis Signed-off-by: Thorsten Leemhuis --- scripts/checkpatch.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 78cc595b98ce..d739ce0909b1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3250,6 +3250,18 @@ sub process { $commit_log_possible_stack_dump = 0; } +# Check for odd tags before a URI/URL + if ($in_commit_log && + $line =~ /^\s*(\w+):\s*http/ && $1 ne 'Link') { + if ($1 =~ /^v(?:ersion)?\d+/i) { + WARN("COMMIT_LOG_VERSIONING", + "Patch version information should be after the --- line\n" . $herecurr); + } else { + WARN("COMMIT_LOG_USE_LINK", + "Unknown link reference '$1:', use 'Link:' instead\n" . $herecurr); + } + } + # Check for lines starting with a # if ($in_commit_log && $line =~ /^#/) { if (WARN("COMMIT_COMMENT_SYMBOL", From patchwork Fri Jan 20 12:35:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thorsten Leemhuis X-Patchwork-Id: 46315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp172770wrn; Fri, 20 Jan 2023 04:36:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXu93gyODm9ABAjQAo6L2PMLpnfqjFYfflOriyilXER84uziIbQeXvmbqHidpjXAVm46JYv3 X-Received: by 2002:a17:907:d23:b0:877:6873:70b9 with SMTP id gn35-20020a1709070d2300b00877687370b9mr10568765ejc.29.1674218194014; Fri, 20 Jan 2023 04:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674218193; cv=none; d=google.com; s=arc-20160816; b=BTKBgWgTVRLoeOQ9meXvQViY3lxDcHikzH6vkmet+1Aj9OfEg4rWbT7KgU76l3sD1G jZJQ0xF1UWKjpkCDI+bTG9ubMEuWLwGSXtgo9fy4MAFA98rn/97iuByPAnSijIzViwdX 18vnJJwy9k7rWpMVW0uIzWWz/P8csK5OF5sFddE26RV5ZHf9FWXfzYE1CuISK4PC8jv+ T/6VQhJWe0Az/kRhRONuC9NddAG77gTzR9kijUwaT+ERYoqDgmCwGud+5RsDIHZrXvT0 K2azZ8a9UpLZf8hSxEf6senDtF4/mXHyxBn7OtJFGqHJ+P5d1d+/wV/4Mnlk4ky+YRmK rxiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dXuijO9OGp8Vq/sfQ7Lfn8QrWAQCMKhSoueRZJRzGAU=; b=Kbchjqo34QcAXqP76lIUxNlncw4Cr+Bbu5PWsjcrZ5I2PckSnjM0FzpRhu3kjEBdx6 ofaf97292jhQCs9IzwtyzmzRWHv15opCss0/wpc/Z4bT22tVrHbu+Dz6luvsvHxyzJgp u/9bb237Ezf3d90BQnuXp5ACmqcned177zIsTFMw7d/trB8Pf4Fe2uqK+DZYV3kqyFTC 8VfFvvmj5Fp7i+TuQVrXBP90ZQ9CXcVHAuMjRnTJchGpoZqgKdZAVv0v9brDD2n5tLGq WpMsymJcd/XtUVAmCX/Q0W7MDB/1qfI4MTI6tygrchesLfcniVNIGHLiFMrml3RZNeQ+ +4zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd7-20020a1709069b8700b007ad9c8201e7si22899558ejc.93.2023.01.20.04.36.09; Fri, 20 Jan 2023 04:36:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbjATMfj (ORCPT + 99 others); Fri, 20 Jan 2023 07:35:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbjATMf3 (ORCPT ); Fri, 20 Jan 2023 07:35:29 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1410DBD17B for ; Fri, 20 Jan 2023 04:35:24 -0800 (PST) Received: from ip4d14bd73.dynamic.kabel-deutschland.de ([77.20.189.115] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1pIqc6-0007pV-Ds; Fri, 20 Jan 2023 13:35:22 +0100 From: Thorsten Leemhuis To: Joe Perches , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn Cc: =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH v4 2/3] checkpatch: warn when Reported-by: is not followed by Link: Date: Fri, 20 Jan 2023 13:35:19 +0100 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1674218125;93060bd7; X-HE-SMSGID: 1pIqc6-0007pV-Ds X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755545017418817748?= X-GMAIL-MSGID: =?utf-8?q?1755545017418817748?= From: Kai Wasserbäch Encourage patch authors to link to reports by issuing a warning, if a Reported-by: is not accompanied by a link to the report. Those links are often extremely useful for any code archaeologist that wants to know more about the backstory of a change than the commit message provides. That includes maintainers higher up in the patch-flow hierarchy, which is why Linus asks developers to add such links [1, 2, 3]. To quote [1]: > Again, the commit has a link to the patch *submission*, which is > almost entirely useless. There's no link to the actual problem the > patch fixes. > > [...] > > Put another way: I can see that > > Reported-by: Zhangfei Gao > > in the commit, but I don't have a clue what the actual report was, and > there really isn't enough information in the commit itself, except for > a fairly handwavy "Device drivers might, for instance, still need to > flush operations.." > > I don't want to know what device drivers _might_ do. I would want to > have an actual pointer to what they do and where. Another reason why these links are wanted: the ongoing regression tracking efforts can only scale with them, as they allow the regression tracking bot 'regzbot' to automatically connect tracked reports with patches that are posted or committed to fix tracked regressions. Link: https://lore.kernel.org/all/CAHk-=wjMmSZzMJ3Xnskdg4+GGz=5p5p+GSYyFBTh0f-DgvdBWg@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/ [2] Link: https://lore.kernel.org/all/CAHk-=wjxzafG-=J8oT30s7upn4RhBs6TX-uVFZ5rME+L5_DoJA@mail.gmail.com/ [3] Signed-off-by: Kai Wasserbäch Co-developed-by: Thorsten Leemhuis Signed-off-by: Thorsten Leemhuis Reported-by: syzbot+bba886ab504fcafecafe@syzkaller.appspotmail.com Reported-by: Abaci Robot Reported-by: https://syzkaller.appspot.com/b/5266d464285a03cee9db Reported-by: syzbot+cafecafecaca0cafecafe@syzkaller.appspotmail.com Reported-by: syzbot@syzkaller.appspotmail.com Reported-by: syzbot@syzkaller.appspotmail.com Reported-by: syzbot+df61b36319e045c00a08@syzkaller.appspotmail.com --- scripts/checkpatch.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d739ce0909b1..b74d6002f773 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3155,8 +3155,20 @@ sub process { "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); } } + +# check if Reported-by: is followed by a Link: + if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) { + if (!defined $lines[$linenr]) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: should be immediately followed by Link: to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); + } elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); + } + } } + # Check Fixes: styles is correct if (!$in_header_lines && $line =~ /^\s*fixes:?\s*(?:commit\s*)?[0-9a-f]{5,}\b/i) { From patchwork Fri Jan 20 12:35:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thorsten Leemhuis X-Patchwork-Id: 46316 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp172819wrn; Fri, 20 Jan 2023 04:36:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXv/0wqYJpWPO7qi1fK3zBzFoAZ1vzyhw78OQxlb/tDvDG1OuUtS40vxVH23IjCdaNuV5Tur X-Received: by 2002:a17:906:b30f:b0:838:9c66:cd2f with SMTP id n15-20020a170906b30f00b008389c66cd2fmr15567175ejz.74.1674218202915; Fri, 20 Jan 2023 04:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674218202; cv=none; d=google.com; s=arc-20160816; b=LCJw4/6qYtXAnfEc9IOly21fG2SmWudkig5iuuNsQytvlBWj+lJL4J+JOR5qRxzV4p UD2MphFLVbO3HGJzk3+/IS1jfc94uKZGpcn3XKpMsAUHrZkAdgrkud/JdunFGaK4Prix Qd274h8ZOKACwcoVRq6/YXkwohhfIxyWD0lwlCgY/7iUHjbI1i9DX9cYeowFL8bSim54 75nL4oAdGvGS6HqJ6UxD9jUBG/DpXoaPiuydwdOWqGbyv+cRqnrvmURnJh6SbEeNMhHR T4myGj8c6rbulVbHfeFWAV0fH0MrITSHH3PmKH6wX/JtgJvfYYNl/aP+zxajtgOUqbsX xsxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1VgmYP8WUZB2Vad+WeSPPgsR31giqc2hZUWqyYLjdsE=; b=HIFG6nvTiMRq0JkVo4rhOv0VGVFEySBEukkmEXqt/nzrRfkiN/WYGW9jVeCaftzMmk ldEAiLXZFMTzox1uARflP8lKOLbRLuo1NzYLSvnQxrLPQ9qKxvc+Mj4lCjRSplKVtz9Q CFxfM0qMtOa3MbSPJsWtDkUf2AKmW91jkbSGIsbZbiPuMwyK08WfeHpMNbgK1PVffaH5 YoNf2XFY1ZWF9AbkQNpMU2GGMYU/Omjxn8St/NcAFQ5RsIA8S8bdVifmZZHJOdFxaiwx ICj7v8YQAZ85zzo3hzXi1tzlTZRPGLwnndSt9tK6guIZVZQIlwhzVDy8h9iOs5mq+Qmb X7Tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wl14-20020a170907310e00b00877a8ff69f3si206447ejb.969.2023.01.20.04.36.19; Fri, 20 Jan 2023 04:36:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbjATMfl (ORCPT + 99 others); Fri, 20 Jan 2023 07:35:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbjATMf3 (ORCPT ); Fri, 20 Jan 2023 07:35:29 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14376BD17E for ; Fri, 20 Jan 2023 04:35:24 -0800 (PST) Received: from ip4d14bd73.dynamic.kabel-deutschland.de ([77.20.189.115] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1pIqc6-0007pV-S7; Fri, 20 Jan 2023 13:35:22 +0100 From: Thorsten Leemhuis To: Joe Perches , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn Cc: =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] checkpatch: use proper way for show problematic line Date: Fri, 20 Jan 2023 13:35:20 +0100 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1674218125;93060bd7; X-HE-SMSGID: 1pIqc6-0007pV-S7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755545026422708013?= X-GMAIL-MSGID: =?utf-8?q?1755545026422708013?= Instead of using an unnecessarily complicated approach to print a line that is warned about, use `$herecurr` instead, just like everywhere else in checkpatch. While at it, remove a superfluous space in one of the changed lines, too. In a unmodified line also remove a superfluous check for a space before a signed-off-by tag, to me consistent with the check at the start of the section. All three problems were found by Joe Perches during review of new code inspired by the code modified here. Signed-off-by: Thorsten Leemhuis --- scripts/checkpatch.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b74d6002f773..b1bf0c7b03a7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3142,17 +3142,17 @@ sub process { if ($sign_off =~ /^co-developed-by:$/i) { if ($email eq $author) { WARN("BAD_SIGN_OFF", - "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline); + "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . $herecurr); } if (!defined $lines[$linenr]) { WARN("BAD_SIGN_OFF", - "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline); - } elsif ($rawlines[$linenr] !~ /^\s*signed-off-by:\s*(.*)/i) { + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . $herecurr); + } elsif ($rawlines[$linenr] !~ /^signed-off-by:\s*(.*)/i) { WARN("BAD_SIGN_OFF", - "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . $herecurr . $rawlines[$linenr] . "\n"); } elsif ($1 ne $email) { WARN("BAD_SIGN_OFF", - "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + "Co-developed-by and Signed-off-by: name/email do not match\n" . $herecurr . $rawlines[$linenr] . "\n"); } }