From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=84.16.66.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796163042; b=w/bZYB42jKeBhWBNd2D0qpLkZAOHG2W3MZp/bxsY1+D1N7I+OhckRftWUGodfII6kcsr ISB+ce3kdTKaA59uWk9/PDk1c19lwafDQrAcOmPqKkr8++YQhyfPYt6kdjvx9/brvBLvi H3sj0PQX6V+Zlw8TeF6mGypFUtq5+4PeChcICxAtBo6zf81pKvMz7xovI52rNDtiFxg78 0VUscs7tS2qkRLN07jJzPu7i6eP4APK2U4Ub3Nha1EEAlEdPfWz9tRU3xnBwvq6RvyQZB 6CT/dXR+q1MOlPKRg9/LfWZJWqAkRgZCcwAPi8/t6jv3IeQVj+8lC4ckjrEGwOMPRDw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796163042; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:X-Infomaniak-Routing; bh=TvZJ/FZf4fdLqfSf3PijevpKYTJPj2UsmL+OmTfApZ0=; b=PM1QM3ioqf2XBEnnk6LQjCiGFDzACYbb/V4/W6YeJJYPhTHQfLGTcdpep9ecUzch0N1L CyllN4CLvEm6zhS3wWVkZ9TAA8YBnhWiAg5xga03woR82A0WfU9ZG58B8L2LXXWGjpRbF 5TgSbB0tY57t2K/nA4Za1ihL7mvJryyltHpV+jandKhkj92Og+HOuXhU6tMxTz4mEOoiz JXLBfa7CuubYEeCiNv4pJEI2CTNwib+wdyFWKJtBFv+px0iJCPME5EAKtuoxGB+Ow2Ihu Q1OGosWjfMpCSBXtZUDXH3VKKR7qobQrTuhZnSJMVQ+c0yMTzVcBmfDxUsF4AS3TA4g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=daylightlinux.ch; spf=pass smtp.mailfrom=daylightlinux.ch; dkim=pass header.d=daylightlinux.ch header.i=@daylightlinux.ch header.a=rsa-sha256 header.s=20261016 header.b=D2xlowir; arc=none smtp.remote-ip=84.16.66.174 Received: from smtp-42ae.mail.infomaniak.ch (smtp-42ae.mail.infomaniak.ch [84.16.66.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9606A606A31A for ; Tue, 1 Dec 2026 22:10:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9606A606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=daylightlinux.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=daylightlinux.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=daylightlinux.ch header.i=@daylightlinux.ch header.a=rsa-sha256 header.s=20261016 header.b=D2xlowir Received: from smtp-3-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:4:17::246b]) by smtp-3-3000 (Postfix) with ESMTPS id 4jfFSp1TfYz4VV; Tue, 1 Dec 2026 23:10:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daylightlinux.ch; s=20261016; t=1796163034; bh=TvZJ/FZf4fdLqfSf3PijevpKYTJPj2UsmL+OmTfApZ0=; h=From:To:Cc:Subject:Date:From; b=D2xlowiruNAmIjOkqLTvdZY6JS+B595EoiegE4jdjKGFGa2E3AP+PihxrN8doRr6g PGtWGFvIOFdOrvbCwDHcllnB8N02qIbRgPiJeZDDnzsf3TR0kIAe6DoCKTmNFV3tpt shjKGQlz7ovS5t9X4aqUnudkwnPiOozyJIorgAeWdhbt4jP0bWN9+vJZWqftkrMqbe NySe4/t1kx6j0cQZJ7dSgdmyeYzP4w2rphAypG45kmx0O3bztmeCSczJl8DGq/bjBt e///AwQvu3TDyAfHJ/IlF7fxZL2huuJKNRSwlS24BjiJ1oDbu5Vysq7EoHi0gO5sFe XxMmYNEMLOYsA== Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4jfFSn0XVkzkyH; Tue, 1 Dec 2026 23:10:33 +0100 (CET) Received: from unknown by raspberrypi.home with local (Exim 4.96) (envelope-from ) id 1xYW3U-004khV-25; Tue, 01 Dec 2026 23:10:32 +0100 From: Hamdy Abou El Anein To: nathan@kernel.org, nsc@kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rdunlap@infradead.org, breno3011alves@gmail.com Subject: [PATCH] scripts: checkversion: match complete version macro names Date: Tue, 1 Dec 2026 23:10:29 +0100 Message-ID: <20261201221029.16263-1-info@daylightlinux.ch> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha The version macro checks match substrings of unrelated identifiers. For example, MY_LINUX_VERSION_CODE and KERNEL_VERSION_EXTRA are mistaken for macros from linux/version.h. Also, the non-word character required before KERNEL_VERSION prevents detection at the start of a line. Use word boundaries around the complete set of version macro names to avoid these false positives and detect uses at the start of a line. Tested with all five version macros, longer unrelated identifiers, a macro at the start of a line, unused and needed includes, and existing comment and string handling. AI assistance: ChatGPT identified the issue, prepared the fix and commit message, and ran local regression tests. Signed-off-by: Hamdy Abou El Anein --- scripts/checkversion.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/checkversion.pl b/scripts/checkversion.pl index 94cd49eff605..3685f080f69e 100755 --- a/scripts/checkversion.pl +++ b/scripts/checkversion.pl @@ -44,9 +44,7 @@ foreach my $file (@ARGV) { # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, # LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL, LINUX_VERSION_SUBLEVEL - if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) || - ($_ =~ /LINUX_VERSION_MAJOR/) || ($_ =~ /LINUX_VERSION_PATCHLEVEL/) || - ($_ =~ /LINUX_VERSION_SUBLEVEL/)) { + if (m/\b(?:KERNEL_VERSION|LINUX_VERSION_(?:CODE|MAJOR|PATCHLEVEL|SUBLEVEL))\b/) { $fUseVersion = 1; last if $iLinuxVersion; } -- 2.56.1