From patchwork Wed Dec 16 04:44:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11976483 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 DE641C2BBCD for ; Wed, 16 Dec 2020 04:44:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A0342312E for ; Wed, 16 Dec 2020 04:44:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A0342312E 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 0FD3B6B006E; Tue, 15 Dec 2020 23:44:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AF126B0073; Tue, 15 Dec 2020 23:44:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2C216B0074; Tue, 15 Dec 2020 23:44:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id DC7966B006E for ; Tue, 15 Dec 2020 23:44:42 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A509E181AEF1E for ; Wed, 16 Dec 2020 04:44:42 +0000 (UTC) X-FDA: 77597904804.02.pot17_470a8bc27429 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 8AFBE10097AA0 for ; Wed, 16 Dec 2020 04:44:42 +0000 (UTC) X-HE-Tag: pot17_470a8bc27429 X-Filterd-Recvd-Size: 2215 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Dec 2020 04:44:42 +0000 (UTC) Date: Tue, 15 Dec 2020 20:44:40 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608093881; bh=K/bZBVp903bWP++jQnq7F61aAHPXl38hOH5H3SUsxUM=; h=From:To:Subject:In-Reply-To:From; b=TRAXQbV46Z7HAHPTpD/gxR5unrS1hx9oCUJfEYVzHSuImLf0lkRDdY8hwXD01Jml0 5gDP2LtmZ5mmmzsqoGeapRy/JQkn7Qcd/BXVgXG/pJ2YMhptJauTSqcRbWnTYld5Yn f/PAXIAPG9bnjjlQRe2x0Qhhz6ukxin/bDOn4ZP8= From: Andrew Morton To: akpm@linux-foundation.org, joe@perches.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, trix@redhat.com Subject: [patch 43/95] checkpatch: add a fixer for missing newline at eof Message-ID: <20201216044440.n0lgSiFqI%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: Tom Rix Subject: checkpatch: add a fixer for missing newline at eof Remove the trailing error message from the fixed lines. Link: https://lkml.kernel.org/r/20201017142546.28988-1-trix@redhat.com Signed-off-by: Tom Rix Acked-by: Joe Perches Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/scripts/checkpatch.pl~checkpatch-add-a-fixer-for-missing-newline-at-eof +++ a/scripts/checkpatch.pl @@ -3418,8 +3418,11 @@ sub process { # check for adding lines without a newline. if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { - WARN("MISSING_EOF_NEWLINE", - "adding a line without newline at end of file\n" . $herecurr); + if (WARN("MISSING_EOF_NEWLINE", + "adding a line without newline at end of file\n" . $herecurr) && + $fix) { + fix_delete_line($fixlinenr+1, "No newline at end of file"); + } } # check we are in a valid source file C or perl if not then ignore this hunk