From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 ADD79C433DF for ; Sat, 17 Oct 2020 14:27:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66BE220657 for ; Sat, 17 Oct 2020 14:27:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438344AbgJQO1a (ORCPT ); Sat, 17 Oct 2020 10:27:30 -0400 Received: from smtprelay0224.hostedemail.com ([216.40.44.224]:34802 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2437013AbgJQO13 (ORCPT ); Sat, 17 Oct 2020 10:27:29 -0400 Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave05.hostedemail.com (Postfix) with ESMTP id BCFE5182895B9 for ; Sat, 17 Oct 2020 14:27:28 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id E81DA837F24A; Sat, 17 Oct 2020 14:27:27 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: test28_1d11acb27226 X-Filterd-Recvd-Size: 1964 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Sat, 17 Oct 2020 14:27:27 +0000 (UTC) Message-ID: <25b86b7d30a3a94faf4e7279bcc34af1c522303f.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: add a fixer for missing newline at eof From: Joe Perches To: trix@redhat.com, apw@canonical.com, Andrew Morton Cc: linux-kernel@vger.kernel.org Date: Sat, 17 Oct 2020 07:27:25 -0700 In-Reply-To: <20201017142546.28988-1-trix@redhat.com> References: <20201017142546.28988-1-trix@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-10-17 at 07:25 -0700, trix@redhat.com wrote: > From: Tom Rix > > Remove the trailing error message from the fixed lines > > Signed-off-by: Tom Rix > --- > v2: fix whitespace Thanks Tom. Andrew can you pick this up please? > --- > scripts/checkpatch.pl | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index fab38b493cef..f9e78a5385ad 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3393,8 +3393,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