linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: conf.py: Ignore __counted_by attribute
@ 2023-12-15  0:13 Kees Cook
  2023-12-15  0:25 ` Randy Dunlap
  2023-12-15 16:31 ` Jonathan Corbet
  0 siblings, 2 replies; 4+ messages in thread
From: Kees Cook @ 2023-12-15  0:13 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Kees Cook, kernel test robot, Gustavo A. R. Silva, linux-doc,
	linux-hardening, linux-kernel

It seems that Sphinx is confused by the __counted_by attribute on struct
members. Add it to the list of known attributes.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312150614.kOx8xUkr-lkp@intel.com/
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-doc@vger.kernel.org
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 Documentation/conf.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index d4fdf6a3875a..5898c74b96fb 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -106,6 +106,7 @@ if major >= 3:
             "__weak",
             "noinline",
             "__fix_address",
+            "__counted_by",
 
             # include/linux/memblock.h:
             "__init_memblock",
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: conf.py: Ignore __counted_by attribute
  2023-12-15  0:13 [PATCH] docs: conf.py: Ignore __counted_by attribute Kees Cook
@ 2023-12-15  0:25 ` Randy Dunlap
  2023-12-15  1:03   ` Kees Cook
  2023-12-15 16:31 ` Jonathan Corbet
  1 sibling, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2023-12-15  0:25 UTC (permalink / raw)
  To: Kees Cook, Jonathan Corbet
  Cc: kernel test robot, Gustavo A. R. Silva, linux-doc,
	linux-hardening, linux-kernel



On 12/14/23 16:13, Kees Cook wrote:
> It seems that Sphinx is confused by the __counted_by attribute on struct
> members. Add it to the list of known attributes.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312150614.kOx8xUkr-lkp@intel.com/
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> Cc: linux-doc@vger.kernel.org
> Cc: linux-hardening@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  Documentation/conf.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index d4fdf6a3875a..5898c74b96fb 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -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;


-- 
#Randy
https://people.kernel.org/tglx/notes-about-netiquette
https://subspace.kernel.org/etiquette.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: conf.py: Ignore __counted_by attribute
  2023-12-15  0:25 ` Randy Dunlap
@ 2023-12-15  1:03   ` Kees Cook
  0 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2023-12-15  1:03 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Jonathan Corbet, kernel test robot, Gustavo A. R. Silva,
	linux-doc, linux-hardening, linux-kernel

On Thu, Dec 14, 2023 at 04:25:01PM -0800, Randy Dunlap wrote:
> 
> 
> On 12/14/23 16:13, Kees Cook wrote:
> > It seems that Sphinx is confused by the __counted_by attribute on struct
> > members. Add it to the list of known attributes.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202312150614.kOx8xUkr-lkp@intel.com/
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> > Cc: linux-doc@vger.kernel.org
> > Cc: linux-hardening@vger.kernel.org
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> >  Documentation/conf.py | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/conf.py b/Documentation/conf.py
> > index d4fdf6a3875a..5898c74b96fb 100644
> > --- a/Documentation/conf.py
> > +++ b/Documentation/conf.py
> > @@ -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,

I *think* it does -- I can't reproduce the robot warnings myself.

> 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

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: conf.py: Ignore __counted_by attribute
  2023-12-15  0:13 [PATCH] docs: conf.py: Ignore __counted_by attribute Kees Cook
  2023-12-15  0:25 ` Randy Dunlap
@ 2023-12-15 16:31 ` Jonathan Corbet
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Corbet @ 2023-12-15 16:31 UTC (permalink / raw)
  To: Kees Cook
  Cc: Kees Cook, kernel test robot, Gustavo A. R. Silva, linux-doc,
	linux-hardening, linux-kernel

Kees Cook <keescook@chromium.org> writes:

> It seems that Sphinx is confused by the __counted_by attribute on struct
> members. Add it to the list of known attributes.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312150614.kOx8xUkr-lkp@intel.com/
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> Cc: linux-doc@vger.kernel.org
> Cc: linux-hardening@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  Documentation/conf.py | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index d4fdf6a3875a..5898c74b96fb 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -106,6 +106,7 @@ if major >= 3:
>              "__weak",
>              "noinline",
>              "__fix_address",
> +            "__counted_by",

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-15 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15  0:13 [PATCH] docs: conf.py: Ignore __counted_by attribute Kees Cook
2023-12-15  0:25 ` Randy Dunlap
2023-12-15  1:03   ` Kees Cook
2023-12-15 16:31 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).