Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2578096rdd; Fri, 12 Jan 2024 14:17:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLkP6Xu6KKhvpJidEQdYna3UcIZQ8wNQiE47NHVErZJKqmgCEphISxMMaJr/nqr9gMJ+cw X-Received: by 2002:a05:600c:1f95:b0:40e:6207:2ecf with SMTP id je21-20020a05600c1f9500b0040e62072ecfmr1126715wmb.10.1705097825485; Fri, 12 Jan 2024 14:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705097825; cv=none; d=google.com; s=arc-20160816; b=J+tOwSkbzcMdan7UdPKLKgj9ctEqmpq0Dyiw9mc6Al76QU1ifuXJnWt+rIWnR/cMRF 6StdH3Hje7gLkM7n5eCA+FxanBSok8wxylwnTz8G0WV/dS1QZjV41neY+u86Mlfqkeax iTf0C/hpUgNQ1A5mD8bEZmWgDrYhB95FqW97Ja/9H30ykLWgV5yf2EalTbwyQoooBntE RpXtlEOqJktrwWeb22hL7u7AOjdr9lWGZwrfF40CMU4XVG2kN/LM/YXABJ4X8gH/W2H4 sgxPmXEFqC8OMJ+f39eNXc9JNWSvi3xqb0E/BSGIUocmZR504czRrKqLqXNCwV9EqevM VpGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Lry9qLsx6UZvlRxob1780MirJjVFaR6R1yAoW5+x8Hk=; fh=oNLWLOI2ssewb3F5DcXoPxpG1GvqZmEWgB8ykWAzFAI=; b=rY+b5cNzo7vs58VWtZ5xscPg2PhAWeyMHDRDhCDq+eybY10TydyvH+XPH6bG68pwgO /ZS1pDYfaFvZGkgBv6oMS3o/aMMOJe7zspOFZHiaoPu3uUpmlz+SnwFq3eme9YMZyTJn drmW3ip9GPTy2hC+FD3Dcl8pv6hgPnlazCWzeTUVpep4+x0TNv6vW8gZwo34KzhEJ1aV 0cBOcENY2bk43DGPzGVSkfl1gg/6AMr9uM/Fvm6IgURZ4w3mDZiP01cpPFaMXJNe0Hve v4nH7egRGpqzDcAlIj4ifTAbJ9CEfzfqEWi5cDSGbcEBVfyG1pEV366yLxCVBSq7NAOV W/qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="dc8Z7/ao"; spf=pass (google.com: domain of linux-kernel+bounces-25061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f14-20020a170906494e00b00a2b28d4da62si1690925ejt.9.2024.01.12.14.17.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 14:17:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="dc8Z7/ao"; spf=pass (google.com: domain of linux-kernel+bounces-25061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 038FC1F217CC for ; Fri, 12 Jan 2024 22:17:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C59B017736; Fri, 12 Jan 2024 22:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dc8Z7/ao" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBC5617726 for ; Fri, 12 Jan 2024 22:16:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d3fde109f2so10975ad.1 for ; Fri, 12 Jan 2024 14:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705097814; x=1705702614; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Lry9qLsx6UZvlRxob1780MirJjVFaR6R1yAoW5+x8Hk=; b=dc8Z7/aomT9QRgG04selIE/s6ThMYsbvvNBGU5Rd4gt8HPEsYDKoldeJKLgGgrCPkU 0FCgKDB5Pp5//RhUH7qRDraAXdr66WyaAXr11Ow2eqwWk5Q0YJECKkz8GDj7LYtOcECy DasoPAgX5yyklpg0F/Tpqtv5t9TVNz7SZIQ1PeZPaf10VBlJus0Y+klAya8uH1CrLk3Q Y2/5YRQnRUWFX6uN93ljhRLdqIbL2pZSQWLyKX1TpIR6EBMH9ZcTz33fiJ8b4a/QPOyd GBr9FAXISl3EoNmRcJWOrgh386pRz3hP3yUdAppjQuChiwgk9oei4NzMY+pGUJgc+DLb gvqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705097814; x=1705702614; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Lry9qLsx6UZvlRxob1780MirJjVFaR6R1yAoW5+x8Hk=; b=HeX+kC2736/Cn2h1bqMeWX5QX77TLLnbESPpEwF1ZD6bXGf9e9GNTkE49bA08VzHcd e8W8mUlkTQB9m27mRNhnJGgMQ2M1MwbVyXVbqKNr2/mC05OrVPCGsF9tzhqaZslEaqkP ShxBK5t6l9M+JUemCL88ycoE5OCdOlmBt8mqrKAoM/hDpqVT5iTTHlpSqggEq8R3Znve KbkApbmXEsgcVruoBTC13rV/ytVSXZLygAPPDSyviI2TXRKk7J2cGvXiuhhCWQLvP7DK oKiW7Jwcu+KAH0qb7kP9NKXEVcvKU/Kcw6wx2STBCUZTGgorDkQIWh5z7V85WC/fKvY0 3c1Q== X-Gm-Message-State: AOJu0Yx+w9WmIT2Rlny3FxrgEDuDM3n2sYalDl+qo6DCm9NfMwF9E28Z 9GQM6XofatUcdHWGffjIj6x9KWeIxrqc X-Received: by 2002:a17:902:f544:b0:1d5:4c40:bf01 with SMTP id h4-20020a170902f54400b001d54c40bf01mr22623plf.17.1705097813656; Fri, 12 Jan 2024 14:16:53 -0800 (PST) Received: from google.com (78.250.82.34.bc.googleusercontent.com. [34.82.250.78]) by smtp.gmail.com with ESMTPSA id b13-20020a65668d000000b005cdf0b46fecsm3218397pgw.81.2024.01.12.14.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 14:16:52 -0800 (PST) Date: Fri, 12 Jan 2024 14:16:49 -0800 From: William McVicker To: Joe Perches Cc: Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn , linux-kbuild@vger.kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] checkpatch: allow build files to reference other build files Message-ID: References: <20240112183420.1777576-1-willmcvicker@google.com> <3513adb04d17156242c92121a7aec4515c39bcf5.camel@perches.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3513adb04d17156242c92121a7aec4515c39bcf5.camel@perches.com> On 01/12/2024, Joe Perches wrote: > On Fri, 2024-01-12 at 10:34 -0800, Will McVicker wrote: > > Add an exception to the EMBEDDED_FILENAME warning for build files. This > > fixes the below warnings where the Kconfig and Makefile files reference > > other similarly named build files. > > > > WARNING:EMBEDDED_FILENAME: It's generally not useful to have the > > filename in the file > > #24: FILE: Kconfig:34: > > +source "drivers/willmcvicker/Kconfig" > > > > WARNING:EMBEDDED_FILENAME: It's generally not useful to have the > > filename in the file > > #36: FILE: Makefile:667: > > + } > Makefile > > No need to wrap here I think. You're right. I'll update in v2. > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -3785,7 +3785,9 @@ sub process { > > } > > > > # check for embedded filenames > > - if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) { > > + if ($rawline =~ /^\+.*\b\Q$realfile\E\b/ && > > + $realfile !~ /Kconfig.*/ && > > + $realfile !~ /Makefile.*/) { > > Align to open parenthesis please. > It's not useful to have .* before the / I was following other references in this file, but looks like you're right that it's not needed. Your recommendation passed the tests I have. So I'll update the regex in v2. Thanks, Will > > So perhaps better to be > > if ($rawline =~ /^\+.*\b\Q$realfile\E\b/ && > $realfile !~ /(?:Kconfig|Makefile)/) { > > > WARN("EMBEDDED_FILENAME", > > "It's generally not useful to have the filename in the file\n" . $herecurr); > > } >