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=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 3E91EC35257 for ; Fri, 2 Oct 2020 23:35:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFC6D2072E for ; Fri, 2 Oct 2020 23:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725613AbgJBXfd (ORCPT ); Fri, 2 Oct 2020 19:35:33 -0400 Received: from smtprelay0149.hostedemail.com ([216.40.44.149]:47014 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgJBXfd (ORCPT ); Fri, 2 Oct 2020 19:35:33 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 6F01B837F253; Fri, 2 Oct 2020 23:35:32 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: space18_4f16f18271a8 X-Filterd-Recvd-Size: 1830 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Fri, 2 Oct 2020 23:35:31 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: Emit a warning on embedded filenames From: Joe Perches To: Andrew Morton Cc: Andy Whitcroft , LKML Date: Fri, 02 Oct 2020 16:35:30 -0700 In-Reply-To: <20201002151849.840bd4c1187d870f328da056@linux-foundation.org> References: <1fd5f9188a14acdca703ca00301ee323de672a8d.camel@perches.com> <20201002151849.840bd4c1187d870f328da056@linux-foundation.org> 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 Fri, 2020-10-02 at 15:18 -0700, Andrew Morton wrote: > On Thu, 01 Oct 2020 11:28:10 -0700 Joe Perches wrote: > > > Embedding the complete filename path inside the file > > isn't particularly useful as often the path is moved > > around and becomes incorrect. > > > > Emit a warning when the source contains the filename. > > > > ... > > > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -3273,6 +3273,12 @@ sub process { > > } > > } > > > > +# check for embedded filenames > > + if ($rawline =~ /^\+.*\Q$realfile\E/) { di > > + WARN("EMBEDDED_FILENAME", > > + "It's generally not useful to have the filename in the file\n" . $herecurr); > > + } > > + > > I removed that " di". Please check that I merged the correct version > of this! Thanks, it must have been added accidentally in my email client. Combined, the patches are correct.