Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2611173rwb; Fri, 20 Jan 2023 05:19:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXtu5YWdmUSbK2cfnpF9r8eJib2HxdWmNKYqWn62om+VP63BX4Z3DUz2LnwBIUWb7OOefm2o X-Received: by 2002:a17:906:f0c7:b0:86f:41b2:3e with SMTP id dk7-20020a170906f0c700b0086f41b2003emr14746330ejb.71.1674220768518; Fri, 20 Jan 2023 05:19:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674220768; cv=none; d=google.com; s=arc-20160816; b=HriZlqGiB4z5gsPSGobS68kE9k2jo9LpyQ4J19of7u8OJYHzmWvfZTUp0gOcUa4W3A g6yajuzPyMkNkYVZUIhdVmcbxhM45e1HEv3tAkAUp2tEWu4YBH5GdcRZlf0F1pY8q+IK D/bGSE961VaOGD+FTgsp+AOtPmfJ/u98gqtQrNOSpM5X94TNYg2/Mt1RzAi8hMIJQOe/ SfF/+dWDF8KYW8MQM4KtslVAbkS11lxvaarceyQYmhYjj4nt79ldXqk8JZ5OwaQ5HlWb 8Muc+GjwdWjTgNLlQY708ClzlxYy0X5IcX09uSJFh40NHMYsSQtViMw6TL4xDlNSJLvU 4Ekg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr7-20020a1709073f8700b0086bfaaa9ee1si12912129ejc.198.2023.01.20.05.19.16; Fri, 20 Jan 2023 05:19:28 -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 + 49 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=20Wasserb=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 Content-Transfer-Encoding: 8bit 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 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"); } } -- 2.39.0