From patchwork Wed Dec 16 04:44:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11976487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53E02C4361B for ; Wed, 16 Dec 2020 04:44:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 012A82312E for ; Wed, 16 Dec 2020 04:44:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 012A82312E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 879758D0008; Tue, 15 Dec 2020 23:44:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 827886B0074; Tue, 15 Dec 2020 23:44:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7661E8D0008; Tue, 15 Dec 2020 23:44:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 60CFB6B0073 for ; Tue, 15 Dec 2020 23:44:49 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2F1DE181AEF1E for ; Wed, 16 Dec 2020 04:44:49 +0000 (UTC) X-FDA: 77597905098.24.club54_4717ca927429 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 16F7A1A4A0 for ; Wed, 16 Dec 2020 04:44:49 +0000 (UTC) X-HE-Tag: club54_4717ca927429 X-Filterd-Recvd-Size: 2709 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Dec 2020 04:44:48 +0000 (UTC) Date: Tue, 15 Dec 2020 20:44:47 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608093887; bh=JAnv2w2/QqWSqzDf2E8raK46pGFW+SE2MyJBRVuKHiA=; h=From:To:Subject:In-Reply-To:From; b=zdOCMAEUeyAyjH5MTqzb3B65060CriuPLMI7H7oMymZVxnCGb6O+nrEYJbSvPyZXO V/c6TadGulYhPrmH1cHpnqlpSog8xMjC7oDke3vIWb13CTw+0GDrtTK7agXSSVTbxR SWwn3krexMId+8LJfgo440MN60Gvffy0d9ZloiyY= From: Andrew Morton To: akpm@linux-foundation.org, joe@perches.com, linux-mm@kvack.org, lukas.bulwahn@gmail.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, yashsri421@gmail.com Subject: [patch 45/95] checkpatch: add fix option for GERRIT_CHANGE_ID Message-ID: <20201216044447.EcKBEYEV3%akpm@linux-foundation.org> In-Reply-To: <20201215204156.f05ec694b907845bcfab5c44@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Aditya Srivastava Subject: checkpatch: add fix option for GERRIT_CHANGE_ID Currently, whenever a Gerrit Change-Id is present in a commit, checkpatch.pl warns to remove the Change-Id before submitting the patch. E.g., running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW API to 53 for 22000 series") reports this error: ERROR: Remove Gerrit Change-Id's before submitting upstream Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d Provide a simple fix option by simply deleting the indicated line. Link: https://lkml.kernel.org/r/20201030114447.24199-1-yashsri421@gmail.com Signed-off-by: Aditya Srivastava Acked-by: Joe Perches Cc: Lukas Bulwahn Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/scripts/checkpatch.pl~checkpatch-add-fix-option-for-gerrit_change_id +++ a/scripts/checkpatch.pl @@ -2852,8 +2852,11 @@ sub process { # Check for Gerrit Change-Ids not in any patch context if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) { - ERROR("GERRIT_CHANGE_ID", - "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr); + if (ERROR("GERRIT_CHANGE_ID", + "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } } # Check if the commit log is in a possible stack dump