From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=45.157.188.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796163036; b=yplihrN6ktOj7s7LIh3UE9v6zikqU7+WrIbMzzlpDqfxdQsTH5PXgzQznZBaB7TCwcRy qs0nPJAH1eLdaIkx8slpMxL5HKaT0q3nLYltP3RpfvNEzjMyi+6C7vmAX1AH2LUhpCgxQ LlXBUbAd/QpAlFcoxL8ukARvf0MpvY1Z5aoJaoNeAEF6B8LGnaC9yAzbzG5dR5JxAQUwa GBSmwB9kcrRvq5oaLW+W/1IcpQSEgCMthzcb/Kefp5kTMQ4IKwtlekNHXy7QpHkIaaCss y+2H9xahN7bzGSOyMXp197QEUnl2t+ahgPmUGa4s7nVkb60CRCtO2pgEtwtxUIqk9vg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796163036; 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=NpLDfgo2WkK5oFp/K2B0PuYqu+9XplRjezQ+51plCttq75eiWtUrKcb35rmZPG3u3tHB 9qEnSzzRus9Evow3JygNNDRgPojdr8gY2BObHX6oVVwyJZKipbTrB8AFCN0xbdzePZ27X spLFu0H0N2c/cm0cUDphcvYAuCn/1l050isv7//hlolYFagJM/Dx4tsQYQstRi/IkjxpU utTqzlUh3M+EbXkXHGa0pkMZ+MAT4kFpv9yjSAvwl6sUPMJEmysIY/KBuDXpuT3GbCHKr I1v8f4cZ8ZosAefjMOOAk0KiVCtbcNCeeA+1oOqgin9uebClGwhDffr6XZ89LI/m8Ig== 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=45.157.188.14 Received: from smtp-bc0e.mail.infomaniak.ch (smtp-bc0e.mail.infomaniak.ch [45.157.188.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8534606A31A for ; Tue, 1 Dec 2026 22:10:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A8534606A31A 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-kbuild@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