From nobody Sat Feb 7 17:55:23 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 024982ED860; Tue, 27 Jan 2026 10:13:40 +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=1769508821; cv=none; b=GiFFLFaXT2UDqNIQuH5s9QnnOF85NxXCURv+41khyAIl5KjnxMfFgVvYlm3t/aVC7dJARBJQiwyGCn/9vBOIwwlkWALRdBhGdoeRcP7nODbRM6PrHMpZfK2iErmyUTt1iXes+VBT0b7a/Lb2t55BlNKo2rsbiNorMVxMZb65oUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508821; c=relaxed/simple; bh=59u4RokGX7YOtU3w6aLy3cf17JHxxjI+Ds3wbqpERMk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tXZAubdzJ/3DD1TAIgylxEhB9RCqp0ZycSUJDWg+BpiX1sRWRjttovRBeiGyAi33534Do7bF0ODXMxZSEJOy5o3XiAw0FXHJfWdk/GjhBwdPRgzArxRyYdP+HdktMuKC5nP1sDFAmNAgM8VD6Kt3IFhiHAdUbXnJFLp/5voBS1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K7aUvMIE; 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="K7aUvMIE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BDB3C116C6; Tue, 27 Jan 2026 10:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508820; bh=59u4RokGX7YOtU3w6aLy3cf17JHxxjI+Ds3wbqpERMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K7aUvMIEApSlgN0dmYgcKZeVBzspEVZkOOjTiaxrSbCy1HzTTOoGF+LRUriwTpH0s 36Vqye2QiS1fQY0zHqZnYl9soi4NMCfkXNAXxakc775CT+gKOtzmE5YADmoZR7izLQ ZLqufa391rxQfEv3Q0cFm6/PPCBoO1VQ94BHyOSr+IpAG5Xp4cgDKUdMYtrZGRk67N bjyrLgNuy2y9zRXicdn7nNwfuWQtZrucDJi2dcSs8tYCe+NWamDkNBkwyi85agkKox EPN/IjmP3dKWtXir3LUj8enlTA2UbguF6h0Y4hNT3kKufMhENyHcnkuovBvcxGNco4 L9vAg7cVhDpIw== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4o-0000000BVHP-2acg; Tue, 27 Jan 2026 11:13:38 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 01/14] docs: kdoc_re: add support for groups() Date: Tue, 27 Jan 2026 11:13:20 +0100 Message-ID: <9402e3ae306d9a0c00dbdcfa2e5fc670b5b2d199.1769508371.git.mchehab+huawei@kernel.org> 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 an equivalent to re groups() method. This is useful on debug messages. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_re.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_= re.py index 2dfa1bf83d64..78322bbf29e4 100644 --- a/tools/lib/python/kdoc/kdoc_re.py +++ b/tools/lib/python/kdoc/kdoc_re.py @@ -103,6 +103,13 @@ class KernRe: =20 return self.last_match.group(num) =20 + def groups(self): + """ + Returns the group results of the last match + """ + + return self.last_match.groups() + =20 class NestedMatch: """ --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 3CEC02ECE9B; Tue, 27 Jan 2026 10:13:41 +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=1769508821; cv=none; b=dSHOb4lGHT4yhIyGRB+Kxm4NXdyY+abQCyhOtq0nGvW3gciY+m+x0MzbcR8Vz4gPzHBwBalf0AGPglCGCazplD4/bK4F70rkGsyocpKZRsRDBhwlH7BG1xgs005vlD6bmXystbvjdKTwa0/5Nz83IgwGLvbGFOZayfiOZ5/PRtc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508821; c=relaxed/simple; bh=vKb19cG6OgBr5ql7sUWNlT1BfFB8/8ARacrIsLZ926E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qfo4K7VNmYt8maVCuaJ1AMV6nL9TTYBlOoHRArnnbdpeQ4XfcQdegiwrMItq4AsN4XZSlXyn3SW4K+S6GSyBMGMaT+AcSvPFnp7uhREJUInqyZdWyldAT3xUxOl/QLT1YmM5mdQ56YB+OLNuLGoKIjfq/h1U+5vnrj2mobarGqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hLSMyY3Q; 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="hLSMyY3Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5700C19425; Tue, 27 Jan 2026 10:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508820; bh=vKb19cG6OgBr5ql7sUWNlT1BfFB8/8ARacrIsLZ926E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hLSMyY3QjgHB4OQam4WZOn0JRpONPcIHuHbZiG2Hj2B1lljB+wi1u1Q8eEBZXueVr S8KcaCWPXtpwcBGZUHdT2wzihpTbRep4oMiI8idRQhjFw6pCpE14TE3WCDfO6d7P1s n3QaD0z5pgCrsSxU6+UUsjv2b9qfQj/ffVIbbCbQeZgL8Y9XTf8wpsvJvF+wn5C6jh pu0rt8U3NHizC2dH+GW15jj8tAHVlfZlfupXffIHKsxR5R1m+pRsx8dCcibi7PlhtW GuTduo7QjFlUor8r7BSCtHsMq2KELLFgImsLldpjv4TA1b0hJy5HfCxrE2WntKnwzw 9aLolQRkS8y2A== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4o-0000000BVIa-3x21; Tue, 27 Jan 2026 11:13:38 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 02/14] docs: kdoc_re: don't go past the end of a line Date: Tue, 27 Jan 2026 11:13:21 +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 The logic which checks if the line ends with ";" is currently broken: it may try to read past the buffer. Fix it by checking before trying to access line[pos]. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_re.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_= re.py index 78322bbf29e4..3c759199ccf0 100644 --- a/tools/lib/python/kdoc/kdoc_re.py +++ b/tools/lib/python/kdoc/kdoc_re.py @@ -261,7 +261,7 @@ class NestedMatch: out +=3D new_sub =20 # Drop end ';' if any - if line[pos] =3D=3D ';': + if pos < len(line) and line[pos] =3D=3D ';': pos +=3D 1 =20 cur_pos =3D pos --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 1E99D2EFDBF; Tue, 27 Jan 2026 10:13:41 +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=1769508821; cv=none; b=GDiaQ0JQRvBF93xwOUN+InnHUoPHtkgOpGE3hNDB7RAS0RKNW6JVETfTmdO2PCP391RUapfx6JGIJzny+beqA/csYQLcWCsE6St2JnOXNVKQ+IwazDAuW51KTHxe2cRHqag0FOkIgSl8HYqv6zm77Rb9CgIKdkYAA6nzueBm4UE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508821; c=relaxed/simple; bh=BKELuR1jUEbVcQzQ17K35Ky0N8JEPhnejnuv0Z8iM9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IHtCBC4byGfc34nD7hWSaHD3Ju8uVSZeA1myhLSAL34a9hqBA7RMlPAm7jjZos46nB8RsSE4gA45ymhovJlOidheZfDuTsPFCj4dhCWRscXfiXm7aXtJWrIuZiuhivI+jlFWRuoDUouX4QyQH0pW2vISHxsJlDokAziWOilSCTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IhtkOvgr; 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="IhtkOvgr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFC68C2BC87; Tue, 27 Jan 2026 10:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508821; bh=BKELuR1jUEbVcQzQ17K35Ky0N8JEPhnejnuv0Z8iM9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IhtkOvgrSVW4I8SyxhkgoSLKIy5px+0opKNiq0R9EBQsLOYO6Yt23DHTXDtDP7q64 yBKY9Lx6McocNWYOQ0aHiZL6d68Qp2pNxwZMJkCPzRcG+u3DM/K2bWTgthYCsk4UXK zaQkdt6HiwRLmdjmUBLZIHnaClHGEKA6uZfKeWy+Iw8RGjIjqBDQSvdnTmjMx2lbtX KiVJN0GWQY2+Y59+SiouhWXcSIjvXslBpQfnaNFn1TD5t7wdVW9GmrlvSlgOCbjchP /S2gEmHT+l+HyWqd+gV4XS483ObhJXQqS4bN3oEVzC8pflfUnJkICLVEfWN5j0zW1F ahGuNAVYWTq6g== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4p-0000000BVJm-12jZ; Tue, 27 Jan 2026 11:13:39 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 03/14] docs: kdoc_parser: move var transformers to the beginning Date: Tue, 27 Jan 2026 11:13:22 +0100 Message-ID: <19eb57add5abd47948598ada7c860d67e8235775.1769508371.git.mchehab+huawei@kernel.org> 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 Just like functions and structs had their transform variables placed at the beginning, move variable transforms to there as well. No functional changes. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index c03505889dc2..de75b102dd64 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -194,6 +194,18 @@ function_xforms =3D [ (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+")= , ""), ] =20 +# +# Transforms for variable prototypes +# +var_xforms =3D [ + (KernRe(r"__read_mostly"), ""), + (KernRe(r"__ro_after_init"), ""), + (KernRe(r"(?://.*)$"), ""), + (KernRe(r"(?:/\*.*\*/)"), ""), + (KernRe(r";$"), ""), + (KernRe(r"=3D.*"), ""), +] + # # Apply a set of transforms to a block of text. # @@ -955,15 +967,6 @@ class KernelDoc: ] OPTIONAL_VAR_ATTR =3D "^(?:" + "|".join(VAR_ATTRIBS) + ")?" =20 - sub_prefixes =3D [ - (KernRe(r"__read_mostly"), ""), - (KernRe(r"__ro_after_init"), ""), - (KernRe(r"(?://.*)$"), ""), - (KernRe(r"(?:/\*.*\*/)"), ""), - (KernRe(r";$"), ""), - (KernRe(r"=3D.*"), ""), - ] - # # Store the full prototype before modifying it # @@ -987,7 +990,7 @@ class KernelDoc: # Drop comments and macros to have a pure C prototype # if not declaration_name: - for r, sub in sub_prefixes: + for r, sub in var_xforms: proto =3D r.sub(sub, proto) =20 proto =3D proto.rstrip() --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 82BE333BBCB; Tue, 27 Jan 2026 10:13:41 +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=1769508821; cv=none; b=PuluYWXG/4vPCAWe8n8onczn/r7Wq+t9eTixEUR3wF6vfu68l3F4VyPxa3X9f+8SGmvvv84e4/L557VKMOHw8fQccLKFXMHaAyCY2YGtb60f5xRdXwnj7f6MhgIquZGY6CitfcicQhy6+j8190rWdk8LO4+V/mt12fyo+XSoxZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508821; c=relaxed/simple; bh=+xVptzqRruVFqEOm9JgDrCeaX8+5ZVn9iOeipoWVdOM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ij8RZbeVsfUBZkUfo1kgESiFcxnyjuFq7awNpk9ZTJ2+UXprIebmCNjMQMgPrPvjP5pDGOaoMwAHQ+EyOG20BqD13WwxGCNDtn1j7P5wQchBNjrmHkqlKKaRbaIuMhqP2FV7rM7xQT+fl/H6WSzPHvs8o4Hk3nxqPttGAFwMQtw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LRdc03mE; 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="LRdc03mE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C0F4C116C6; Tue, 27 Jan 2026 10:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508821; bh=+xVptzqRruVFqEOm9JgDrCeaX8+5ZVn9iOeipoWVdOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LRdc03mEksiMbO5EihWeqkPc4EC65xmD5ew1lx3nf+in0wIZDbLqaSp9MqbsnO9hF ZUwGbYPKO3ldcJ49bOBjZDTolEaJMl6zEopZcGujtUrZVJu6Rt55rG59XRuzbsoQXR /etpug0uFo3T0iXLBT916WgSKSEvHukI/K4pv+RhbDLuSdnBCGJZxT5UNafyPv4qrN QIopQFKp7zftXQ/ysmiZtK2l5VbX469blgKHyWE489VgWUAc2bVyPHNeb5f5YmCHQz nNJX91CewqfBo9NX8VfdXKx6GE2XSjpdlCu+DVVkh6cfEFcGuuWnxLMwXEvmx3NKBe cyVX9A9Xvnq3w== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4p-0000000BVKx-2ET0; Tue, 27 Jan 2026 11:13:39 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 04/14] docs: kdoc_parser: don't mangle with function defines Date: Tue, 27 Jan 2026 11:13:23 +0100 Message-ID: <2ef0ce1d668207cdbab9ffe9ebb568c9f4135de7.1769508371.git.mchehab+huawei@kernel.org> 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 Mangling with #defines is not nice, as we may end removing the macro names, preventing several macros from being properly documented. Also, on defines, we have something like: #define foo(a1, a2, a3, ...) \ /* some real implementation */ The prototype part (first line on this example) won't contain any macros, so no need to apply any regexes on it. With that, move the apply_transforms() logic to ensure that it will be called only on functions. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index de75b102dd64..834a527542b3 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -166,7 +166,7 @@ struct_nested_prefixes =3D [ # # Transforms for function prototypes # -function_xforms =3D [ +function_xforms =3D [ (KernRe(r"^static +"), ""), (KernRe(r"^extern +"), ""), (KernRe(r"^asmlinkage +"), ""), @@ -1049,10 +1049,7 @@ class KernelDoc: found =3D func_macro =3D False return_type =3D '' decl_type =3D 'function' - # - # Apply the initial transformations. - # - prototype =3D apply_transforms(function_xforms, prototype) + # # If we have a macro, remove the "#define" at the front. # @@ -1071,6 +1068,11 @@ class KernelDoc: declaration_name =3D r.group(1) func_macro =3D True found =3D True + else: + # + # Apply the initial transformations. + # + prototype =3D apply_transforms(function_xforms, prototype) =20 # Yes, this truly is vile. We are looking for: # 1. Return type (may be nothing if we're looking at a macro) --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 CA00833AD90; Tue, 27 Jan 2026 10:13:41 +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=1769508821; cv=none; b=lDYXwzejRDfcT0ACzNCqDrn0k8C+ofFjJB74ynuZUlh9piwBY1jk7zSVWLz5EKQH5qhrY/vBRi16hPElhoWwts14pQ4FUaSCwhQQJNEma+4r131LAOvbYI3vgZlMmidr0wY4+Q1W/fzvC359MZWl7JGwRKzcTJg+DooTb0QUwQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508821; c=relaxed/simple; bh=tG5aGGSXPFMShMecDATAc+9bVZNzWuT+AaBVlR45Rk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l/E+QNJnJKx9DudBAeJUn1C1jGFeIueAcvzII7lJiY7jW5CU36DC/cdgTcBGScYAmz0zCtSOjbeg4JSScpyvNxqaOtKFLiGMk4NHoxwbjHsKzIXq5tjxW2+sW1n4WL4CgtFo7HmvV3P0vLYq1HQEPi1WnmxJl/stcDodIS3VfwE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bkLSFp8w; 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="bkLSFp8w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 934A6C19425; Tue, 27 Jan 2026 10:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508821; bh=tG5aGGSXPFMShMecDATAc+9bVZNzWuT+AaBVlR45Rk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkLSFp8wGKPaxWg5wD9dgl9JVGg/nlPRKQ9GPi3S837OgDT1JFlg5XvjdPIfRcaLo KZSjpHRN/XA9sBwcXnFDWb640NSe/7n3exfyRmq7FiuP7B1rirZyIaxHApkCM0r1kQ 6qjcD97kPjOGKfZ+2CHUMikEgpGTp4/6AS2xZf4bGUeQrxWFEPTfPVKWt/wYkE3uRP Tb1EXqrguqNpglQO4DnTel/JQPwFhQUfPjIma4OIFJCQRiMf7UwSn7YFOoPTk9ilkW DpvqD2uUIFk0O00VNEow3jMBRvzxyZmY4XdpzayJlLNDbt7mhllWtGUA19vHfg7fWh 5CavfS1CiraYA== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4p-0000000BVM8-3SFI; Tue, 27 Jan 2026 11:13:39 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 05/14] docs: kdoc_parser: add functions support for NestedMatch Date: Tue, 27 Jan 2026 11:13:24 +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 Some annotations macros may have nested parenthesis, causing normal regex parsing to fail. Extend apply_transforms to also use NestedMatch and add support for nested functions. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 39 ++++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 834a527542b3..4b2b0a0d25f8 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -155,7 +155,7 @@ struct_xforms =3D [ (KernRe(r'DEFINE_DMA_UNMAP_LEN\s*\(' + struct_args_pattern + r'\)', re= .S), r'__u32 \1'), ] # -# Regexes here are guaranteed to have the end delimiter matching +# Struct regexes here are guaranteed to have the end delimiter matching # the start delimiter. Yet, right now, only one replace group # is allowed. # @@ -163,6 +163,13 @@ struct_nested_prefixes =3D [ (re.compile(r'\bSTRUCT_GROUP\('), r'\1'), ] =20 +# +# Function Regexes here are guaranteed to have the end delimiter matching +# the start delimiter. +# +function_nested_prefixes =3D [ +] + # # Transforms for function prototypes # @@ -206,14 +213,6 @@ var_xforms =3D [ (KernRe(r"=3D.*"), ""), ] =20 -# -# Apply a set of transforms to a block of text. -# -def apply_transforms(xforms, text): - for search, subst in xforms: - text =3D search.sub(subst, text) - return text - # # A little helper to get rid of excess white space # @@ -400,6 +399,8 @@ class KernelDoc: # Place all potential outputs into an array self.entries =3D [] =20 + self.nested =3D NestedMatch() + # # We need Python 3.7 for its "dicts remember the insertion # order" guarantee @@ -497,6 +498,16 @@ class KernelDoc: # State flags self.state =3D state.NORMAL =20 + def apply_transforms(self, regex_xforms, nested_xforms, text): + """Apply a set of transforms to a block of text.""" + for search, subst in regex_xforms: + text =3D search.sub(subst, text) + + for search, sub in nested_xforms: + text =3D self.nested.sub(search, sub, text) + + return text.strip() + def push_parameter(self, ln, decl_type, param, dtype, org_arg, declaration_name): """ @@ -865,11 +876,9 @@ class KernelDoc: # Go through the list of members applying all of our transformatio= ns. # members =3D trim_private_members(members) - members =3D apply_transforms(struct_xforms, members) + members =3D self.apply_transforms(struct_xforms, struct_nested_pre= fixes, + members) =20 - nested =3D NestedMatch() - for search, sub in struct_nested_prefixes: - members =3D nested.sub(search, sub, members) # # Deal with embedded struct and union members, and drop enums enti= rely. # @@ -1072,7 +1081,9 @@ class KernelDoc: # # Apply the initial transformations. # - prototype =3D apply_transforms(function_xforms, prototype) + prototype =3D self.apply_transforms(function_xforms, + function_nested_prefixes, + prototype) =20 # Yes, this truly is vile. We are looking for: # 1. Return type (may be nothing if we're looking at a macro) --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 727A833C530; Tue, 27 Jan 2026 10:13:42 +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=1769508822; cv=none; b=rlU5stPDiVC8+1qTxlDmO7qAr5P/GMnFmaSJc3CIFeHJ2EubDNMXS+j4CpTKRKznhuww5zXM/7irlquYi0WWFo+6tF/ur6NXBDtLLYSQHdIumX3uFduqE7/v8bP7/UlK3kp5gFXch0tJfJvWcZWEpqyKlQk+Hz/CDbnhUmy5R7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508822; c=relaxed/simple; bh=0GXTBopIxXVRl5wO2lQk4NHBxkgOqte8Dyp2ZYXlg+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aX6BMXUpOg9cJvVtYP0nMztnPZI1whHF5GBw4+UGlX3AgBsajAod3m+uvr4R3jFsHSqUD8HCBUYbQOC/sg7ujAq1S4JcLd4gI4n9BhUX2RBkhfK6rQfXaQOiwCsBBIb0hweyVs9W7LGx8/wT1U1DCWNiPa00YqvdEj1jfm+KIU4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TbgbIRbu; 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="TbgbIRbu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C8FC19425; Tue, 27 Jan 2026 10:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508822; bh=0GXTBopIxXVRl5wO2lQk4NHBxkgOqte8Dyp2ZYXlg+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TbgbIRbuDsuRJG4TM4xKHHvuJDz4vA3NgsXSKZPBrpS6CIdTO4X/zFZE80OAJOMrv D9WQ4SbOPkpvhjJh1vb/tBfzvPNh2Z1aUFtxu6wrFmO6heh+kTBZYbZuNsSXYYtXmy 8nUlmBkOwEICGXiu0jmDerce89NBI2OjMYbkiZKVPbvgZFB7o6fmkKlNN7rJZRobkj JhGe1bZkg599uMdyTJYYTYJ8fwXCuI92gUpaD+rjRAdN6bo5NfVNwGRpZT58/QObvf A14xp30pgEB/xwZJQsxafQrjEw2m2ol5zyE6v8DDJVqa1K832Wd2LUJ+y6YirDuVwl OfKNdzp1L4Nsw== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4q-0000000BVNJ-0wAH; Tue, 27 Jan 2026 11:13:40 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 06/14] docs: kdoc_parser: use NestedMatch to handle __attribute__ on functions Date: Tue, 27 Jan 2026 11:13:25 +0100 Message-ID: <3635b0e33c260555d5be131d171ac494ba436932.1769508371.git.mchehab+huawei@kernel.org> 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 Some annotations macros may have nested parenthesis, causing normal regex parsing to fail. The __attribute__ regex is currently very complex to try to avoid that, but it doesn't catch all cases. Ensure that the parenthesis will be properly handled by using the NestedMatch() logic. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 4b2b0a0d25f8..0310aff7b2fe 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -168,6 +168,7 @@ struct_nested_prefixes =3D [ # the start delimiter. # function_nested_prefixes =3D [ + (re.compile(r"__attribute__\s*\("), ""), ] =20 # @@ -198,7 +199,6 @@ function_xforms =3D [ (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""), (KernRe(r"DECL_BUCKET_PARAMS\s*\(\s*(\S+)\s*,\s*(\S+)\s*\)"), r"\1, \2= "), (KernRe(r"__attribute_const__ +"), ""), - (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+")= , ""), ] =20 # --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 912FA33CE87; Tue, 27 Jan 2026 10:13:42 +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=1769508822; cv=none; b=mvfL8HBce+nBPdp+y/sL7uRLyKVeozEw63vr2ivd6uGbDVGGteHg2ol8ZDhCL15P2UpwLmCyKMXHuC5gdd3NL+TB9jajBt/56hg7UVB4DAd+XDSYoO/gZIlLVrfRVMXoEFYZnFyhxxyBnB/3IDmXBgq6wLGfGK/Fiq8qVkJTmGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508822; c=relaxed/simple; bh=5PF5pCPRF220uosYxLa1L/x3iiDLCcrrvPFVvrrqnag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lexoVUiNm63To9AbpzLAyasD3/fNMfK2jcF70AGJgg8qyRyyyVScF7svL7+9rc84ksF7eJkeHt5E+SwtG3ayWIhXUphOVsD3eL8LRsTXVdTw9I8VlTpYoLbxFShW6fr5bLdVBr+fsgSIzb7oiWoGmEt324lHFUtLJIUJdEArdc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vEXMZO/C; 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="vEXMZO/C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DEB6C2BC87; Tue, 27 Jan 2026 10:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508822; bh=5PF5pCPRF220uosYxLa1L/x3iiDLCcrrvPFVvrrqnag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vEXMZO/CymBBWC9Qdc/z3TkWki+6MlGejnT6eJr51J/afvxhhth4HRXMwqC65vY4B igUFRt4rz05ZJ4oJvtxHrwwGUVawE3cACErXR5Ql7bzCIj32SKT6NT+pzz+k8p+YHd LR/LvMVrcla3iIljd7oHxmdHfFQRYLOfvY8ckksPhziZIg3VClkEXH/sq6OTLiKBZI lnPam8GuPnaNKIgG8aLAGV8hTXUsyE67ya2bo99cCoWT64VP/lsf31NGxyHyBieDmg zW9uY62/u5MzmxB6VAXk5EfxHU9+u7nx9mifmbE/ZlHpF4TRKv8m79OoCUTf1jdT69 +M6cOugRKcIYQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4q-0000000BVOU-2PVT; Tue, 27 Jan 2026 11:13:40 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 07/14] docs: kdoc_parser: fix variable regexes to work with size_t Date: Tue, 27 Jan 2026 11:13:26 +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 The regular expressions meant to pick variable types are too naive: they forgot that the type word may contain underlines. Co-developed-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 0310aff7b2fe..94721d6a8204 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -1010,14 +1010,14 @@ class KernelDoc: =20 default_val =3D None =20 - r=3D KernRe(OPTIONAL_VAR_ATTR + r"\w.*\s+(?:\*+)?([\w_]+)\s*[\d\]\= []*\s*(=3D.*)?") + r=3D KernRe(OPTIONAL_VAR_ATTR + r"[\w_]*\s+(?:\*+)?([\w_]+)\s*[\d\= ]\[]*\s*(=3D.*)?") if r.match(proto): if not declaration_name: declaration_name =3D r.group(1) =20 default_val =3D r.group(2) else: - r=3D KernRe(OPTIONAL_VAR_ATTR + r"(?:\w.*)?\s+(?:\*+)?(?:[\w_]= +)\s*[\d\]\[]*\s*(=3D.*)?") + r=3D KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_]*)?\s+(?:\*+)?(?:[\w= _]+)\s*[\d\]\[]*\s*(=3D.*)?") if r.match(proto): default_val =3D r.group(1) =20 --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 E5E3C33D6C2; Tue, 27 Jan 2026 10:13:43 +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=1769508824; cv=none; b=pXupF4/4evQfKxVDWomUwH6qB2wkJStKFtIImQ4CXi41O66dw1fvtXQQJFQnjsJKJ0Fl98r6F5/culRnpQ5Y5wpqnprtjfEDXZt11LAzA/JAGy/unHvB8zEkbaVzJaw2YQ23INTyK1FWR8XkxRuWNJ81bW8mw1jtNKE4XaP9d5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508824; c=relaxed/simple; bh=5//ZOdfzPAeDsrOOPfY5KESFavGP66fIfvEIEsMy5Zs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GNoB8t3H6CDNtAl7Tjv0Or3B7tOf02l7jLgDDCWSpsI+s13EglMK6m45VtPxpKxrj+zdkotZJ7Pu6UJqMbk2BTD2H9TnFmeHHsdcXMXoGenr+D44AaE5DwF67arj7F6qlCp9kgIefSF0CuWMc/8ESonBaaeuj7OeoCxfFPFjJAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e9qYPv1n; 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="e9qYPv1n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 977D7C2BC9E; Tue, 27 Jan 2026 10:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508822; bh=5//ZOdfzPAeDsrOOPfY5KESFavGP66fIfvEIEsMy5Zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9qYPv1nOAfF1zoRgDeRgk/jhvKvKcERG0IuoEoffZ9HG+XY0ExzfcxJKC3ohwlVo M/DHwRkrfdspGJQ3qVth4VI9uVGb+xbbK8x8M1WUtbCrkMHx8gDIGJ8gKGsWNbsBr/ Sz2eisxD/ArdZFSzikitdjjXgewzzh11P+t1fZPoRX3fqGk85UbFvJx2XB5WQm3feZ XBeh/kC76uT31839Z+28mZni7dA6sEnG8XOkCU45tnHFDPHG60NTO9Vsn28owD2iyP RErGvqRu5WvJ751wCWCkSRZLGLGJ8bAwCmc2UnP61Y2NuvT0Vtnb8O/BIynXVhU+4v Wbl+DQLtvGh+Q== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4q-0000000BVPh-3gxa; Tue, 27 Jan 2026 11:13:40 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 08/14] docs: kdoc_parser: fix the default_value logic for variables Date: Tue, 27 Jan 2026 11:13:27 +0100 Message-ID: <8ddd54068e779a0258d4f007bd0a8667c42175c5.1769508371.git.mchehab+huawei@kernel.org> 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 The indentation is wrong for the second regex, which causes problems on variables with defaults. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 94721d6a8204..85f4e90c49c8 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -1018,9 +1018,9 @@ class KernelDoc: default_val =3D r.group(2) else: r=3D KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_]*)?\s+(?:\*+)?(?:[\w= _]+)\s*[\d\]\[]*\s*(=3D.*)?") - if r.match(proto): - default_val =3D r.group(1) =20 + if r.match(proto): + default_val =3D r.group(1) if not declaration_name: self.emit_msg(ln,f"{proto}: can't parse variable") return --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 9C87B33B975; Tue, 27 Jan 2026 10:13:43 +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=1769508823; cv=none; b=bnNsJJD2woc3aNPNT6cKGJ66IFsHeMw4OdCNdcj3V/6kpBOtosgJW1dvIkUUFHYR04yt4+oklnUcp8w/InYSamWmro80gk8g/r9NwpIpzQY2xfiGfiwB9zS4gsq5YsW57gHSNpnB2TLRoYTf3O4L9ZFb4T5lOc/j/+6k4BDiiis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508823; c=relaxed/simple; bh=r7AQAavBSNUMsivwwiBxtssyZ9U5aFJ2qZKecZbMdAE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b/9tOKvUUb6CBz/E5IxLpjKgnUlDXQdEnqF615epplN79DnJsiUweVxEcI5LI/U3TG4eJA4wBVNAQ0nWp8DfskEwNpVexihJW+2rMRkvOenQpj+TaDqUbrDFMO4lg7Kitf0SFU0hs2Vh9+wWGdwZKL4NPVSNFxB/BaNwxptzQuo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H0RJzA1T; 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="H0RJzA1T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBA80C2BC87; Tue, 27 Jan 2026 10:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508822; bh=r7AQAavBSNUMsivwwiBxtssyZ9U5aFJ2qZKecZbMdAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H0RJzA1TIbKUEYo53MVrgut3xHG0oHhimt2FBMoniEBEg2p8lrz1zCfLcynCK1MGf Jajd4Cj+c+6TyQu7zOmS+QyiNMoTv1/3SiGxjJ2WBb7qVgzttrotqyXXg04fMW7cGn Y9zob4gP5S9qa0yGn+4n2O3UT4Co2wjaXiudYoI6mT0pQzMJ9jY5Ogd1i2XFrLQ1S0 98JxSqmnJqNQyVyr5P6MVny9TnHri3l3+qgRaY4zjpdVY8FoIbDqFRoFadwQXiPuul ga/sD0lsElTY+Me+3/tjsvbJ5QcwG7G3a3EcEj0SLK6A5x/s+5scsEGwTQ1LP+g9SX 07ZVwO3TBFtYQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4r-0000000BVQs-0jak; Tue, 27 Jan 2026 11:13:41 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 09/14] docs: kdoc_parser: add some debug for variable parsing Date: Tue, 27 Jan 2026 11:13:28 +0100 Message-ID: <0fae69123a26955743ca1a8485fbea87135470a3.1769508371.git.mchehab+huawei@kernel.org> 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 This is a new parser that we're still fine-tuning. Add some extra debug messages to help addressing issues over there. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 85f4e90c49c8..38d415778a7c 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -1016,11 +1016,19 @@ class KernelDoc: declaration_name =3D r.group(1) =20 default_val =3D r.group(2) + + self.config.log.debug("Variable proto parser: %s from '%s'", + r.groups(), proto) + else: r=3D KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_]*)?\s+(?:\*+)?(?:[\w= _]+)\s*[\d\]\[]*\s*(=3D.*)?") =20 if r.match(proto): default_val =3D r.group(1) + + if default_val: + self.config.log.debug("default: '%s'", default_val) + if not declaration_name: self.emit_msg(ln,f"{proto}: can't parse variable") return @@ -1028,6 +1036,9 @@ class KernelDoc: if default_val: default_val =3D default_val.lstrip("=3D").strip() =20 + self.config.log.debug("'%s' variable prototype: '%s', default: %s", + declaration_name, proto, default_val) + self.output_declaration("var", declaration_name, full_proto=3Dfull_proto, default_val=3Ddefault_val, --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 6976A2EB847; Tue, 27 Jan 2026 10:13:44 +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=1769508824; cv=none; b=fqYYR2cTactnbTpVWuxINTp1rqmuvHCbzINMtJzWPxf63yIyNGFXLKdxQ+YBN6GfgeXt9yBJLpCP5UnVA3KtNp8ZJiXg7aSt81MjOXJJToNEMKE1xWRGXVPEkgmYBIFYBLSofQFw3MQWpJvyls679YBxzyo+wgWbcZO4m6YAQE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508824; c=relaxed/simple; bh=ke0HGtScLJiBKD8MrGheWvUGb+iFmgWRAEg0k71Rkk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bjl9vejXF2Cxlh2jPT8D/IOPx+KdbK1NIp6fn7tkGkPy7db0OxS/9CW5HRw7WFcSNhBUpTel8pG8iOPEq0qSy+VxG3WAnltzVHQwhkiKFb1BbESrAUhGZnVWZSYTJTzNPl+rzJ4bC68Mnl64k/sXEku+ZQMoUnxoQhDjl4WDe1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LGRwvzsA; 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="LGRwvzsA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA4A3C2BCAF; Tue, 27 Jan 2026 10:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508824; bh=ke0HGtScLJiBKD8MrGheWvUGb+iFmgWRAEg0k71Rkk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGRwvzsAL3UyI/I7TkM1KkLkilf2x1Xk6CJECtoyLostdlQFHpOjObU36S/YLHZrW qBbyR+8oDw7Ep+0N2CEizsiQBvJKPxxUIJ0fqkQuV2fzePqCLm6NW9LvRBX+Tx8asn Re+Z7PXwiLpi6aYTiPB9QEu3grnxuOhHDWtoKon+F/ncrMsmMBrH7UBlGtzt5ov1vJ G0k9NirGgEP0STBCHZYk9UYN4fYiAJXNdtoWpvQwSMN0OVAqdlzinhIgGKLaFpl/jz xHv2/e0cTHHJGLP4adw4NtXNNGo8Xnn4Aw3q1wLvnHSSkumDUIiuQEuG9Zykrlcyvv DuX5Tya32xyxw== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4r-0000000BVS5-2OiP; Tue, 27 Jan 2026 11:13:41 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 10/14] docs: kdoc_parser: don't exclude defaults from prototype Date: Tue, 27 Jan 2026 11:13:29 +0100 Message-ID: <3ff0619365bc401b70e9fd818b58e02337574b8b.1769508371.git.mchehab+huawei@kernel.org> 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 If we do that, the defaults won't be parsed. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 38d415778a7c..ee3a09396a78 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -210,7 +210,6 @@ var_xforms =3D [ (KernRe(r"(?://.*)$"), ""), (KernRe(r"(?:/\*.*\*/)"), ""), (KernRe(r";$"), ""), - (KernRe(r"=3D.*"), ""), ] =20 # --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 0B75930EF6F; Tue, 27 Jan 2026 10:13:44 +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=1769508824; cv=none; b=cTRdLBEFaNXnMuuH+GSfgGrhv6ZCm+KULaBp8YPMYVPuVYcZox8By8oTqPlLHE+uP/vRHrf/LNbdwmVjhUFQrDNvcu/1oE560iCOqNdlyWxCsuTgyRz/cel7RLU//XdefYFp+zCfxt3IlTwlJ9MlXDXMrUk0IzYDsg+jeEG8k/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508824; c=relaxed/simple; bh=K6lgztanQK3FhPi/2k/qKibFfdvBvH02DI26eVVDCJE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ah3e7QUIRMIdltGQJn9A9nWAdinFwRqXyczaOu3D0bn88CpphcM3ph5huDs59fDXpkRmw2QrXqtrAKxP66iLhLi23wYpkrBogqCqsr+EMWwVvoDuO9s1YTTXLUnNtQBaFWlm/wmbuGWSYLgUVVI0qd1PnbcxmAAPagYsLLOcERM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dgUOrDPj; 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="dgUOrDPj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E515CC4AF0C; Tue, 27 Jan 2026 10:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508823; bh=K6lgztanQK3FhPi/2k/qKibFfdvBvH02DI26eVVDCJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dgUOrDPjusY1lvYPQrXE1WmcZPN8nJyKWdZIaI+/nWK7byy4c6ZPDVFBKhUrPEMjQ vZ/BK/QKC9F2xFYPLDlsvdelTXTxeiCRdLwboQGTj0BuIHXw6INga97tqNk+Gvpi4h XE3IE9lRScd5vTq3z9VcvMy3SehQeMEShysg9CAe86sjARfbep+NVqBYN0x+H6n0t3 mB3j9yg+9/dSaOjZPfT9E3pttAAtUOyzHCyWK+/QnLUqWCGojzNJJGZdSCbFeGdg2W fUDhD0UC6KF723X11ZUBkKtNy+TZbXclCXcRzndkLasFVGaIleXNQAJoe/b+xGGajQ osR8nmyDc2L/g== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4r-0000000BVTH-3ceC; Tue, 27 Jan 2026 11:13:41 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 11/14] docs: kdoc_parser: fix parser to support multi-word types Date: Tue, 27 Jan 2026 11:13:30 +0100 Message-ID: <9bfa6b2325075af1850919285327601730a9b210.1769508371.git.mchehab+huawei@kernel.org> 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 The regular expression currently expects a single word for the type, but it may be something like "struct foo". Add support for it. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index ee3a09396a78..8531113ee28d 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -1009,7 +1009,7 @@ class KernelDoc: =20 default_val =3D None =20 - r=3D KernRe(OPTIONAL_VAR_ATTR + r"[\w_]*\s+(?:\*+)?([\w_]+)\s*[\d\= ]\[]*\s*(=3D.*)?") + r=3D KernRe(OPTIONAL_VAR_ATTR + r"\s*[\w_\s]*\s+(?:\*+)?([\w_]+)\s= *[\d\]\[]*\s*(=3D.*)?") if r.match(proto): if not declaration_name: declaration_name =3D r.group(1) @@ -1020,7 +1020,7 @@ class KernelDoc: r.groups(), proto) =20 else: - r=3D KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_]*)?\s+(?:\*+)?(?:[\w= _]+)\s*[\d\]\[]*\s*(=3D.*)?") + r=3D KernRe(OPTIONAL_VAR_ATTR + r"(?:[\w_\s]*)?\s+(?:\*+)?(?:[= \w_]+)\s*[\d\]\[]*\s*(=3D.*)?") =20 if r.match(proto): default_val =3D r.group(1) --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 272C833D6C8; Tue, 27 Jan 2026 10:13:44 +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=1769508824; cv=none; b=tKxgklsR0hgG4h4/DLHP05AQEGwAr63iMsqOv3Jh74sZRdcpD6Em5Ngue2FybvLFt1gYinXjvpPN3jmERHisPPp45ZQnwDukXfR1toemJY/P8b73xJAcAvNQWSfMd5e9RLxAQW2WLrCSxVdfL9vkhhuVHjiP5fXed2YN2Rw+tWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508824; c=relaxed/simple; bh=Uh8fp8VyF/1ltE83ak+3CvQjcTkAdEIyegGiBxaXQkw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aFim4CEgaORObt77uF8KEtkYZ9nRf3zuLupF3uf1iRP6E25E9QMxOnm8QrPXs0O+6k9VjA2HL+XV98LLJgjpNsfEm/WDLvZSbKJSnNQ0gd1aVzJ3G7d2FZJi2KcoK8HWrGQ30sBjcJPRtf8R6H7VBBDfxTPdPzw4kTEExriuoQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ckQKpfBE; 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="ckQKpfBE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07432C2BCB0; Tue, 27 Jan 2026 10:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508824; bh=Uh8fp8VyF/1ltE83ak+3CvQjcTkAdEIyegGiBxaXQkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ckQKpfBETHK7JSeKIrNVyMGOJXqFn5JdXGOzGX857vqqTgUGMFq75EUOjXTzKfG1z dvKDFgj8WHnznTI/HuyPdT4XUT6PH0cAIP6ikGk/fayq/Yx/cv8IKusHoOfZRaekmN xMqTLTgqpTdwluvzrW8BlozmCHlUPjE7UnnFWtuOVw8tv6IjGGHh0U+HzUVSH2QELJ +rVdrkY6vJx/+VpB2PBlqwGLOtGdfa1dWKWeZf0u0BpVFvZErb4U0goCuOwXnStOPk I+Whjmser9ahJq+inzKP54oGKSjIULUSGtPaF+bKVsPLBKBm5hRotMWBCh56usd4xE toatnGl7dW1RQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4s-0000000BVUT-18O9; Tue, 27 Jan 2026 11:13:42 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 12/14] docs: kdoc_parser: ignore context analysis and lock attributes Date: Tue, 27 Jan 2026 11:13:31 +0100 Message-ID: <3e9526b30b58b34251b88403ee75523a96f69b6a.1769508371.git.mchehab+huawei@kernel.org> 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 From: Randy Dunlap Drop all context analysis and lock (tracking) attributes to avoid kernel-doc warnings. Documentation/core-api/kref:328: ../include/linux/kref.h:72: WARNING: Inval= id C declaration: Expected end of definition. [error at 96] int kref_put_mutex (struct kref *kref, void (*release)(struct kref *kref)= , struct mutex *mutex) __cond_acquires(true# mutex) -------------------------------------------------------------------------= -----------------------^ Documentation/core-api/kref:328: ../include/linux/kref.h:94: WARNING: Inval= id C declaration: Expected end of definition. [error at 92] int kref_put_lock (struct kref *kref, void (*release)(struct kref *kref),= spinlock_t *lock) __cond_acquires(true# lock) -------------------------------------------------------------------------= -------------------^ The regex is suggested by Mauro; mine was too greedy. Thanks. Updated context analysis and lock macros list provided by PeterZ. Thanks. Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/all/20260107161548.45530e1c@canb.auug.org.a= u/ Signed-off-by: Randy Dunlap Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- tools/lib/python/kdoc/kdoc_parser.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 8531113ee28d..4507f6159a75 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -84,6 +84,8 @@ struct_xforms =3D [ (KernRe(r'\s*__aligned\s*\([^;]*\)', re.S), ' '), (KernRe(r'\s*__counted_by\s*\([^;]*\)', re.S), ' '), (KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '), + (KernRe(r'\s*__guarded_by\s*\([^\)]*\)', re.S), ' '), + (KernRe(r'\s*__pt_guarded_by\s*\([^\)]*\)', re.S), ' '), (KernRe(r'\s*__packed\s*', re.S), ' '), (KernRe(r'\s*CRYPTO_MINALIGN_ATTR', re.S), ' '), (KernRe(r'\s*__private', re.S), ' '), @@ -168,6 +170,16 @@ struct_nested_prefixes =3D [ # the start delimiter. # function_nested_prefixes =3D [ + (re.compile(r"__cond_acquires\s*\("), ""), + (re.compile(r"__cond_releases\s*\("), ""), + (re.compile(r"__acquires\s*\("), ""), + (re.compile(r"__releases\s*\("), ""), + (re.compile(r"__must_hold\s*\("), ""), + (re.compile(r"__must_not_hold\s*\("), ""), + (re.compile(r"__must_hold_shared\s*\("), ""), + (re.compile(r"__cond_acquires_shared\s*\("), ""), + (re.compile(r"__acquires_shared\s*\("), ""), + (re.compile(r"__releases_shared\s*\("), ""), (re.compile(r"__attribute__\s*\("), ""), ] =20 @@ -198,6 +210,7 @@ function_xforms =3D [ (KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""), (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""), (KernRe(r"DECL_BUCKET_PARAMS\s*\(\s*(\S+)\s*,\s*(\S+)\s*\)"), r"\1, \2= "), + (KernRe(r"__no_context_analysis\s*"), ""), (KernRe(r"__attribute_const__ +"), ""), ] =20 @@ -207,6 +220,8 @@ function_xforms =3D [ var_xforms =3D [ (KernRe(r"__read_mostly"), ""), (KernRe(r"__ro_after_init"), ""), + (KernRe(r'\s*__guarded_by\s*\([^\)]*\)', re.S), ""), + (KernRe(r'\s*__pt_guarded_by\s*\([^\)]*\)', re.S), ""), (KernRe(r"(?://.*)$"), ""), (KernRe(r"(?:/\*.*\*/)"), ""), (KernRe(r";$"), ""), --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 73B5233A010; Tue, 27 Jan 2026 10:13:44 +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=1769508824; cv=none; b=oevCO4kyJw0tyzdLfJisbK/c19s3QQrpF4lC9w81Ez2ilpj6LogcHLWLAKEHEf9X8Zm7eYpl+uZMVhviTcz9o6S8oxDSDs8tK0ahKNZ2N1vNZNmLnCUNkltEBueZqMRkGmaR8HarhisDeOAevORwql+6nehTIqagHEqGTYiFQwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508824; c=relaxed/simple; bh=hIvi/x00utHlTyl9n0S6bmr97RufBc5sZd869/LJ4Pc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MouBTA20HrTHEyeoXggTl6NKb1V+JAUoMwN+qLmhIpYEiru/CDvfH8XRXYDflFFWLfR57WGQC5/JGC58W39PxMTCHaXiCczhcnYCe5v+Ho1O5UhdlymThn72STNAPseRfqzPkHHSCIr1pRk4dxz3Mrqlg2pCFhS04FDwt3AMDeo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ic4gfE4n; 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="ic4gfE4n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53D71C16AAE; Tue, 27 Jan 2026 10:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508824; bh=hIvi/x00utHlTyl9n0S6bmr97RufBc5sZd869/LJ4Pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ic4gfE4nv3XivmehOdrUGWq9WTTXdsGawoXY/K9TXfVKo8ZPNy8vp7NfKtSU3+QDg 6Vhjv9jPF/krOMTyw/h9XhEiXeJXfqyO6GoZCohQ4CiRFPKaQw+V2UBZlrBYWVku5w DquyRQPoLFuBdfcOQJfATwNi1JnO7TSUxowfRQLfd/kaybW9IMMEzyIwoDg5/yq/O9 XXb1r2XkQmxjK15+Gly0r3DwEkrLvSUAM6KvTmce7laAGC7gMYTJyn3HRz4gyeMSgF wja5k9DCC27qhzAPP5WpsPjoKACzSxw9r85SfASOp//ZWbYDaT2cwvUcSxIUXBd3Fe bKJhtas5ojO4A== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4s-0000000BVVj-2QEZ; Tue, 27 Jan 2026 11:13:42 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 13/14] docs: kdoc_parser: add support for LIST_HEAD Date: Tue, 27 Jan 2026 11:13:32 +0100 Message-ID: <680aae024b4292f3dbc40bf1b9e556e95aef890a.1769508371.git.mchehab+huawei@kernel.org> 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 Convert LIST_HEAD into struct list_head when handling its prototype. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 4507f6159a75..4be7728a5e62 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -222,6 +222,7 @@ var_xforms =3D [ (KernRe(r"__ro_after_init"), ""), (KernRe(r'\s*__guarded_by\s*\([^\)]*\)', re.S), ""), (KernRe(r'\s*__pt_guarded_by\s*\([^\)]*\)', re.S), ""), + (KernRe(r"LIST_HEAD\(([\w_]+)\)"), r"struct list_head \1"), (KernRe(r"(?://.*)$"), ""), (KernRe(r"(?:/\*.*\*/)"), ""), (KernRe(r";$"), ""), --=20 2.52.0 From nobody Sat Feb 7 17:55:23 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 940F533C1BF; Tue, 27 Jan 2026 10:13:45 +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=1769508825; cv=none; b=Rqfs+mHrHaiPUrQiwMWpAEPb/NlWtRnhcRs7xCMzByhtaV4RjiPW0rtGCeNyV9kUnb133xCRbrLEaXpxO8x7Paz2PMMxrt4ULkfVQMoG8nxcgl1mBpGOnAq4OFbqtZYIp3+duPZacArqZNYj/K8g8HBMQ/9JN1W5s3tBAOD57/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508825; c=relaxed/simple; bh=XFIpcjRKktodju0Cjd6RYExE3T6O0QCEiKFyxSSf/Rc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TpsyIgMzZqsneC24wPQmEhrdoPwJS1ybMvfXVW7Lm6ZMnEDJL51Yk2Oeh90PI2Rjafwviw4KkHSnpacLizgJr7RJReI46UbvmyE8yCyJhPVYHvMu4cPe053Qgvj2JDuYjf9MrzQnMlacZHxGyywMcpurexLeYVRoqPovJkb61c0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=af8coZA9; 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="af8coZA9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97863C2BC9E; Tue, 27 Jan 2026 10:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769508824; bh=XFIpcjRKktodju0Cjd6RYExE3T6O0QCEiKFyxSSf/Rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=af8coZA9BUPEDoer1KvA4BldlCunm220DeBeveB8Shw78WEQLnksm1FVs0ZXmqw8Z 4DmZgJNJHE6yHw3DQrvFZzOkIfmUjkg9VzUgzR+PxPVraJn2/7/6GWd6VlXdkArnuF ysn6fy2aE8Pu36+w3RuNu9ZjeI4VL24RkziF6a0stgEOVn1cRKPbsfG9biEf9A9zkp /TgHR8TOWAxsMUfQwqQ5iZQri2Tbty3T2dq/rjy2+ASsQBMgl8yM4sU8ltBvBl0bMx kDF9mIFg/ePRw4hqC7lHNIaoT6VbnM5y3RAZFzYSMQQYa/C0mjw41e4MOVAzoW9DAg 18GjiLrYQVcdQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vkg4s-0000000BVWv-3jhz; Tue, 27 Jan 2026 11:13:42 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Subject: [PATCH 14/14] kdoc_parser: handle struct member macro VIRTIO_DECLARE_FEATURES(name) Date: Tue, 27 Jan 2026 11:13:33 +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 From: Randy Dunlap Parse the macro VIRTIO_DECLARE_FEATURES(name) and expand it to its definition. These prevents one build warning: WARNING: include/linux/virtio.h:188 struct member 'VIRTIO_DECLARE_FEATURES(= features' not described in 'virtio_device' Signed-off-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab --- tools/lib/python/kdoc/kdoc_parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index 4be7728a5e62..4696be9212a0 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -155,6 +155,7 @@ struct_xforms =3D [ struct_args_pattern + r'\)', re.S), r'\1 \2[]'), (KernRe(r'DEFINE_DMA_UNMAP_ADDR\s*\(' + struct_args_pattern + r'\)', r= e.S), r'dma_addr_t \1'), (KernRe(r'DEFINE_DMA_UNMAP_LEN\s*\(' + struct_args_pattern + r'\)', re= .S), r'__u32 \1'), + (KernRe(r'VIRTIO_DECLARE_FEATURES\(([\w_]+)\)'), r'union { u64 \1; u64= \1_array[VIRTIO_FEATURES_U64S]; }'), ] # # Struct regexes here are guaranteed to have the end delimiter matching --=20 2.52.0