docs: conf.py: Ignore __counted_by attribute
PATCH 1/1 docs: conf.py: Ignore __counted_by attribute
It seems that Sphinx is confused by the __counted_by attribute on struct members. Add it to the list of known attributes.
--- Documentation/conf.py | 1 + 1 file changed, 1 insertion(+)
Documentation/conf.py +1 -0
@@ -106,6 +106,7 @@ if major >= 3: "__weak", "noinline", "__fix_address", + "__counted_by", # include/linux/memblock.h: "__init_memblock",
Signature · 1 line
2.34.1
Randy Dunlap
reviewerQuoted 19 lines · Kees Cook
It seems that Sphinx is confused by the
__counted_byattribute on struct members. Add it to the list of known attributes.Reported-by kernel test robot <[email protected]>Cc Jonathan Corbet <[email protected]>Cc "Gustavo A. R. Silva" <[email protected]>Signed-off-by Kees Cook <[email protected]>--- Documentation/conf.py | 1 + 1 file changed, 1 insertion(+)Documentation/conf.py +0
-0
Documentation/conf.py if major >= 3: · line 112
Quoted 7 lines
Documentation/conf.py +1
-0@@ -106,6 +106,7 @@ if major >= 3: "__weak", "noinline", "__fix_address", + "__counted_by", # include/linux/memblock.h: "__init_memblock",
If Sphinx needs to know about that, then fine. OTOH, for scripts/kernel-doc, a similar change could have been made to dump_struct(), along with these others:
# strip attributes $members =~ s/\s*$attribute/ /gi; $members =~ s/\s*__aligned\s*\([^;]*\)/ /gos; $members =~ s/\s*__packed\s*/ /gos; $members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =~ s/\s*____cacheline_aligned_in_smp/ /gos; $members =~ s/\s*____cacheline_aligned/ /gos;
Signature · 3 lines
#Randy https://people.kernel.org/tglx/notes-about-netiquette https://subspace.kernel.org/etiquette.html
Quoted 27 lines · Randy Dunlap
Quoted 24 lines · Kees Cook
It seems that Sphinx is confused by the
__counted_byattribute on struct members. Add it to the list of known attributes.Reported-by kernel test robot <[email protected]>Cc Jonathan Corbet <[email protected]>Cc "Gustavo A. R. Silva" <[email protected]>Signed-off-by Kees Cook <[email protected]>--- Documentation/conf.py | 1 + 1 file changed, 1 insertion(+)Documentation/conf.py +1
-0@@ -106,6 +106,7 @@ if major >= 3: "__weak", "noinline", "__fix_address", + "__counted_by",
Quoted 4 lines
Documentation/conf.py if major >= 3: · line 112
Quoted 2 lines
Documentation/conf.py +0
-0# include/linux/memblock.h: "__init_memblock",If Sphinx needs to know about that, then fine. OTOH, for
scripts/kernel-doc,
I *think* it does -- I can't reproduce the robot warnings myself.
Quoted 10 lines
a similar change could have been made to
dump_struct(), along with these others:# strip attributes $members =~ s/\s*$attribute/ /gi; $members =~ s/\s*__aligned\s*\([^;]*\)/ /gos; $members =~ s/\s*__packed\s*/ /gos; $members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =~ s/\s*____cacheline_aligned_in_smp/ /gos; $members =~ s/\s*____cacheline_aligned/ /gos;
scripts/kernel-doc doesn't actually need this -- it already processes struct members in a way that seems to ignore trailing attributes.
-Kees
Signature · 1 line
Kees Cook
Quoted 19 lines · Kees Cook
It seems that Sphinx is confused by the
__counted_byattribute on struct members. Add it to the list of known attributes.Reported-by kernel test robot <[email protected]>Cc Jonathan Corbet <[email protected]>Cc "Gustavo A. R. Silva" <[email protected]>Signed-off-by Kees Cook <[email protected]>--- Documentation/conf.py | 1 + 1 file changed, 1 insertion(+)Documentation/conf.py +0
-0
Documentation/conf.py if major >= 3: · line 109
Quoted 4 lines
Documentation/conf.py +1
-0@@ -106,6 +106,7 @@ if major >= 3: "__weak", "noinline", "__fix_address", + "__counted_by",
Applied, thanks.
jon