From nobody Fri Apr 3 08:18:17 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 085C334B1B0; Wed, 18 Feb 2026 10:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771409607; cv=none; b=q5w05Sqp7XeB9O7g+WEhSieWMN/Hv16Y6FZp+Zjtos85R1VKtPEYi6+3Ka4MUMQXbmld6m06e8oXuXwxLgb3yGp/tVBAulthsxZyB8NWww2+ziBUS+/dHEFtNe9RgJtjHjIzeQp90u2AE6wJci+6D7p28TbJsChhdJqXGmTTk5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771409607; c=relaxed/simple; bh=86xDsz00XoZv72qsVxrMGG+DckqmwvjpK6jYFBlRKlc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YmKURQRFtN4FSMvSRxb7X+EX8rHmQq9wMOHgxrsSO0KpGL2BLsQ8cXGpseGB4Zug+UdhyjXLX502eudD+9j2B97K9ey3IK5/mKzT0cnF18p92gUoSZMzhopXcXD53y0EzKVHG8bdsOV0TZeowq/B2C0kx6xtCoqUjTDTjXKs76s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iJgsNj1I; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iJgsNj1I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFFA8C19421; Wed, 18 Feb 2026 10:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771409606; bh=86xDsz00XoZv72qsVxrMGG+DckqmwvjpK6jYFBlRKlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJgsNj1ILFH/W404vgqOOGidsNLkMe7JdUEX16v4Uau/P2nB9asfrZh/MsBF6mG1p +dXmaF+m95974ysB4gS0Hdt73+2d0dETu3C4BvovzUrKcfvucv2NqxnM0kbuNcv1g+ yT/AEh39PjncL/tuEIYKGo6UfJVkKSh/W04IAWASLWUxWHrSokyUNVLThZiCIwgSNP X9tTUZq41lIw4eb4XKnGUr+/yWpCMbdQEU2VHjZh3G+tRj4bD+P1j/DRuPgijn6vW8 wczH34zjTznei9NFRqdXI6agVnpnSHAK5GvxBwwPB9G3X5Msy+nfKKFHtdlRFHwpo0 YlzAUxHzoIZAw== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vseYf-00000000Llw-00lq; Wed, 18 Feb 2026 11:13:25 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , intel-wired-lan@lists.osuosl.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Aleksandr Loktionov , Randy Dunlap Subject: [PATCH 23/38] docs: kdoc_re: add a helper class to declare C function matches Date: Wed, 18 Feb 2026 11:12:53 +0100 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: 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="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Add a more convenient class to match C functions and avoiding issues at the beginning and ending of NestedMatch inits. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Aleksandr Loktionov --- tools/lib/python/kdoc/kdoc_re.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_= re.py index cdc842f5fc8f..f72b80ea4f1b 100644 --- a/tools/lib/python/kdoc/kdoc_re.py +++ b/tools/lib/python/kdoc/kdoc_re.py @@ -383,3 +383,14 @@ class NestedMatch: """ =20 return f'NestedMatch("{self.regex.regex.pattern}")' + + +class CFunction(NestedMatch): + r""" + Variant of NestedMatch. + + It overrides the init method to ensure that the regular expression will + start with a ``\b`` and end with a C function delimiter (open parenthe= sis). + """ + def __init__(self, regex): + self.regex =3D KernRe(r"\b" + regex + r"\s*\(") --=20 2.52.0