From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=199.89.1.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796165648; b=ZXxbVW+SlMeg2u0PnORFuswhMX0/9gWn3xXPVFDpo3e0mqzsF7K9NH5kVI/bevtq8srR whKnBK7dVB0uockvcwxSmHZVjiVFOh29qIEVceOHugkMf0s9dxdn7YJz5/6vo45CcdA02 1Yy1JjWH6pWYZIPlWHZcpC8dLjRuFXuuOcx53BPDpK0AFP2rZpDgiuoyZz9gCVgsNILcU UGgwzCioADeev4u8ihciupc2uVHLRhD279L9CDrM5YDUsaSDPimOZBFbbZTue2fqarkhL quIjmF0a/2EjjxNMt4+svxqZaKToIl2QOXK+MJQmeniBWILVE55tosUReBfNwYkWW9w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796165648; h=DMARC-Filter:Received:DKIM-Signature:X-Virus-Scanned:Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; bh=ghyEGaRSSEwk7eVsb7mqB/cFpf+xIaafYwU7/uKJ7V4=; b=UYhVyE9qJtdB/n6NhkErT0BZCNBfqXXm+afuCg605QikbRAQdkImbEjqBAlj6vErCylt uPtzibX8EADMFKTxWOXdKy9ispLLIGKM+szB6FTQ7QrNrHmn59GVvCRTYfSQKIkw9haN6 UVwbRcgOBPHXsqTLyGJu9AK5xL3rFFQu9S3j1zPG0nlMa9sNaH2iOAKop3a5HpztDp3ED Uka5nZ8B3V2pw2mDlOBJ0ZSUVwIn6Ln+ielwUOh0zCSKXjlZI00wALyZiHH2cUc9GwNzd h9AieQOjVWO3tDptPZffHv086Mo2R/OAfC1y4SofuDonuKAzq71EtO9A1go0O0O9qiA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass header.d=acm.org header.i=@acm.org header.a=rsa-sha256 header.s=mr01 header.b=YDa3lVn3; arc=none smtp.remote-ip=199.89.1.14 Received: from 011.lax.mailroute.net (011.lax.mailroute.net [199.89.1.14]) (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 D41EE606A32F for ; Tue, 1 Dec 2026 22:54:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D41EE606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=acm.org header.i=@acm.org header.a=rsa-sha256 header.s=mr01 header.b=YDa3lVn3 Received: from localhost (localhost [127.0.0.1]) by 011.lax.mailroute.net (Postfix) with ESMTP id 4jfGR33Dr3z1XMYJN; Tue, 1 Dec 2026 22:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1796165645; x=1798757646; bh=ghyEG aRSSEwk7eVsb7mqB/cFpf+xIaafYwU7/uKJ7V4=; b=YDa3lVn3bjQnWGp5FRWnt PH5j9pBiOju3EfgrKrudEGJMSjPX7YOgBew0vE7J7qiHBe9duxwMsTVyRbY9CXg9 Cqw6xswyBYS7jvYlvoh1XsZC0jWYsrGW50fEmu5QjJH9DzOKMMViDHmmF8fkqPy8 suEaX5jP8Nh92oAFcYZDHSGRodDLRWMjWmtfAFnY4rZAesOS98ZxjPw7JwphbsWL llXF00BzgQZFI020aWe7+OfD56PfeMrR8CCXHdP2iuQNRhrpDd1CbdTLqK3zUYe+ NZFUmVZqcR1OpjbtV2qJBfzyT25wwAq3mNwWaws633CWPaEg8d9BbFRf/nP+Jx7q Q== X-Virus-Scanned: by MailRoute Received: from 011.lax.mailroute.net ([127.0.0.1]) by localhost (011.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id HQGjTYLJjO2B; Tue, 1 Dec 2026 22:54:05 +0000 (UTC) Received: from bvanassche.c.googlers.com.com (57.237.82.34.bc.googleusercontent.com [34.82.237.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 011.lax.mailroute.net (Postfix) with ESMTPSA id 4jfGQz45rJz1XMYJX; Tue, 1 Dec 2026 22:54:03 +0000 (UTC) From: Bart Van Assche To: Joe Perches , Andy Whitcroft Cc: Andrew Morton , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH 04/10] checkpatch: skip redundant build_types() rebuilds Date: Tue, 1 Dec 2026 14:53:48 -0800 Message-ID: <570c8f871e5296d0b049c3228bd4b1eb4890c981.1796165270.git.bvanassche@acm.org> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog In-Reply-To: References: 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: quoted-printable Call build_types() at the end of the per-file loop only when @modifierListFile or @typeListFile is non-empty, and call build_types() i= n possible() only when a new modifier or type is appended. Avoid rebuilding the composite $Type, $NonptrType, and $Declare regular expressions and invalidating Perl's cached patterns that interpolate them when the per-file type and modifier lists have not changed. Signed-off-by: Bart Van Assche --- scripts/checkpatch.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4ca3ce0f4502..ffafef4cd4f1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1545,9 +1545,11 @@ for my $filename (@ARGV) { @fixed_inserted =3D (); @fixed_deleted =3D (); $fixlinenr =3D -1; - @modifierListFile =3D (); - @typeListFile =3D (); - build_types(); + if (@modifierListFile || @typeListFile) { + @modifierListFile =3D (); + @typeListFile =3D (); + build_types(); + } $file =3D $oldfile if ($is_git_file); } =20 @@ -2508,6 +2510,7 @@ sub possible { # Check for modifiers. $possible =3D~ s/\s*$Storage\s*//g; $possible =3D~ s/\s*$Sparse\s*//g; + my $types_changed =3D 0; if ($possible =3D~ /^\s*$/) { =20 } elsif ($possible =3D~ /\s/) { @@ -2516,14 +2519,16 @@ sub possible { if ($modifier !~ $notPermitted) { warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible)= ; push(@modifierListFile, $modifier); + $types_changed =3D 1; } } =20 } else { warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); push(@typeListFile, $possible); + $types_changed =3D 1; } - build_types(); + build_types() if ($types_changed); } else { warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1); }