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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 307ADC35257 for ; Fri, 2 Oct 2020 22:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E031520738 for ; Fri, 2 Oct 2020 22:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601677131; bh=Wqwf0m/QWXfi+uOhsxyJ2gAfBaP0kgwacLBXPbYLv+w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=DSFS9+x7E0nB5PyCRzSNrm9FB8fkJTaQUIml3yFffwO8SMfhutBSqibBnpx2baxer AC6IWpJqRZ2QKHTFmUbwgR7xsxXcEx5/725mCxfbDVLd1zvrCdyHzk7d4Z6rW/NZ4b gOc/C34KVC2ED6eZRlM0tITPSB1YStMjSmbY7mfE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725796AbgJBWSu (ORCPT ); Fri, 2 Oct 2020 18:18:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:46382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbgJBWSu (ORCPT ); Fri, 2 Oct 2020 18:18:50 -0400 Received: from X1 (c-76-21-107-111.hsd1.ca.comcast.net [76.21.107.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D475120738; Fri, 2 Oct 2020 22:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601677130; bh=Wqwf0m/QWXfi+uOhsxyJ2gAfBaP0kgwacLBXPbYLv+w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=1Nw0aIIcveOAxk+GRw9AQbQMBUZMJ2rygQO81RxOHAtUhqRUUnOFjGZY1/+4mLJ7k F052EphzTjrCFsJWQmRcZp0MHLI77pEC1fmmxPBNaCmxnxJXjGcr9gVPOzJV9UZc/5 nfDt3S8Htu8KAfrnLdpclGv8r1yVzVazf2YNZQrE= Date: Fri, 2 Oct 2020 15:18:49 -0700 From: Andrew Morton To: Joe Perches Cc: Andy Whitcroft , LKML Subject: Re: [PATCH] checkpatch: Emit a warning on embedded filenames Message-Id: <20201002151849.840bd4c1187d870f328da056@linux-foundation.org> In-Reply-To: <1fd5f9188a14acdca703ca00301ee323de672a8d.camel@perches.com> References: <1fd5f9188a14acdca703ca00301ee323de672a8d.camel@perches.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!