diff options
| author | Tudor Ambarus <tudor.ambarus@linaro.org> | 2026-05-06 11:04:12 +0000 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2026-05-15 08:11:36 -0600 |
| commit | 8bf5a177c318737c53e53299eac781a94ad632af (patch) | |
| tree | 4f38bbad8be054cfd4510cbcff0c07b6a26c0a3e /tools/lib/python | |
| parent | 8b9bff97df205c2d6dc65c7997b8d5ee63f5f8ea (diff) | |
| download | lwn-8bf5a177c318737c53e53299eac781a94ad632af.tar.gz lwn-8bf5a177c318737c53e53299eac781a94ad632af.zip | |
docs: kernel-doc: python: strip __counted_by_ptr macro
The `__counted_by_ptr` macro was recently introduced [1] to extend
bounds checking semantics to standard dynamically allocated pointers.
However, the new Python implementation of kernel-doc does not currently
recognize it as a compiler attribute. When kernel-doc encounters a
struct member annotated with this macro, it fails to parse the variable
name correctly, resulting in false-positive warnings like:
Warning: ... struct member '__counted_by_ptr(cmdcnt' not described
Add `__counted_by_ptr` to the `struct_xforms` regex list so it gets
safely stripped out during the parsing phase, mirroring the existing
behavior for `__counted_by`. Update the corresponding unit tests.
Link: https://git.kernel.org/torvalds/c/150a04d817d8 [1]
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260506-kdoc-__counted_by_ptr-v1-1-70763486871f@linaro.org>
Diffstat (limited to 'tools/lib/python')
| -rw-r--r-- | tools/lib/python/kdoc/xforms_lists.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/python/kdoc/xforms_lists.py b/tools/lib/python/kdoc/xforms_lists.py index 496c52188273..8753dd539f23 100644 --- a/tools/lib/python/kdoc/xforms_lists.py +++ b/tools/lib/python/kdoc/xforms_lists.py @@ -29,6 +29,7 @@ class CTransforms: (CMatch("__aligned"), ""), (CMatch("__counted_by"), ""), (CMatch("__counted_by_(le|be)"), ""), + (CMatch("__counted_by_ptr"), ""), (CMatch("__guarded_by"), ""), (CMatch("__pt_guarded_by"), ""), (CMatch("__packed"), ""), |
