linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref
@ 2024-02-27  5:03 Akira Yokosawa
  2024-02-27  5:06 ` [PATCH 2/2] mm/shmem.c: Use new form of *@param in kernel-doc Akira Yokosawa
  2024-02-28 22:40 ` [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Jonathan Corbet
  0 siblings, 2 replies; 4+ messages in thread
From: Akira Yokosawa @ 2024-02-27  5:03 UTC (permalink / raw)
  To: Chandan Babu R, Christoph Hellwig
  Cc: Jonathan Corbet, Mauro Carvalho Chehab, Stephen Rothwell,
	Andrew Morton, linux-xfs, linux-mm, Akira Yokosawa

In kernel-doc comments, unary operator * collides with Sphinx/
docutil's markdown for emphasizing.

This resulted in additional warnings from "make htmldocs":

    WARNING: Inline emphasis start-string without end-string.

, as reported recently [1].

Those have been worked around either by escaping * (like \*param) or by
using inline-literal form of ``*param``, both of which are specific
to Sphinx/docutils.

Such workarounds are against the kenrel-doc's ideal and should better
be avoided.

Instead, add "*" to the list of unary operators kernel-doc recognizes
and make the form of *@param available in kernel-doc comments.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: [1] https://lore.kernel.org/r/20240223153636.41358be5@canb.auug.org.au/
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
---
Note for Chandan

As both of patches 1/2 and 2/2 are needed to resolve the warning from
Sphinx which commit d7468609ee0f ("shmem: export shmem_get_folio") in
the xfs tree introduced, I'd like you to pick them up.

        Thanks, Akira
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index e8aefd258a29..d2f3fa3505c6 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -64,7 +64,7 @@ my $type_constant = '\b``([^\`]+)``\b';
 my $type_constant2 = '\%([-_\w]+)';
 my $type_func = '(\w+)\(\)';
 my $type_param = '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
-my $type_param_ref = '([\!~]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
+my $type_param_ref = '([\!~\*]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)';
 my $type_fp_param = '\@(\w+)\(\)';  # Special RST handling for func ptr params
 my $type_fp_param2 = '\@(\w+->\S+)\(\)';  # Special RST handling for structs with func ptr params
 my $type_env = '(\$\w+)';

base-commit: 4b2f459d86252619448455013f581836c8b1b7da
-- 
2.34.1



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

* [PATCH 2/2] mm/shmem.c: Use new form of *@param in kernel-doc
  2024-02-27  5:03 [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Akira Yokosawa
@ 2024-02-27  5:06 ` Akira Yokosawa
  2024-02-28 22:40 ` [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Jonathan Corbet
  1 sibling, 0 replies; 4+ messages in thread
From: Akira Yokosawa @ 2024-02-27  5:06 UTC (permalink / raw)
  To: Chandan Babu R, Christoph Hellwig
  Cc: Jonathan Corbet, Mauro Carvalho Chehab, Stephen Rothwell,
	Andrew Morton, linux-xfs, linux-mm, Akira Yokosawa

Use the form of *@param which kernel-doc recognizes now.
This resolves the warnings from "make htmldocs" as reported in [1].

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: [1] https://lore.kernel.org/r/20240223153636.41358be5@canb.auug.org.au/
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 mm/shmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index fb76da93d369..cf3689926418 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2152,8 +2152,8 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,
  * There is no need to reserve space before calling folio_mark_dirty().
  *
  * When no folio is found, the behavior depends on @sgp:
- *  - for SGP_READ, *foliop is %NULL and 0 is returned
- *  - for SGP_NOALLOC, *foliop is %NULL and -ENOENT is returned
+ *  - for SGP_READ, *@foliop is %NULL and 0 is returned
+ *  - for SGP_NOALLOC, *@foliop is %NULL and -ENOENT is returned
  *  - for all other flags a new folio is allocated, inserted into the
  *    page cache and returned locked in @foliop.
  *
-- 
2.34.1




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

* Re: [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref
  2024-02-27  5:03 [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Akira Yokosawa
  2024-02-27  5:06 ` [PATCH 2/2] mm/shmem.c: Use new form of *@param in kernel-doc Akira Yokosawa
@ 2024-02-28 22:40 ` Jonathan Corbet
  2024-02-28 23:47   ` Darrick J. Wong
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2024-02-28 22:40 UTC (permalink / raw)
  To: Akira Yokosawa, Chandan Babu R, Christoph Hellwig
  Cc: Mauro Carvalho Chehab, Stephen Rothwell, Andrew Morton,
	linux-xfs, linux-mm, Akira Yokosawa

Akira Yokosawa <akiyks@gmail.com> writes:

> In kernel-doc comments, unary operator * collides with Sphinx/
> docutil's markdown for emphasizing.
>
> This resulted in additional warnings from "make htmldocs":
>
>     WARNING: Inline emphasis start-string without end-string.
>
> , as reported recently [1].
>
> Those have been worked around either by escaping * (like \*param) or by
> using inline-literal form of ``*param``, both of which are specific
> to Sphinx/docutils.
>
> Such workarounds are against the kenrel-doc's ideal and should better
> be avoided.
>
> Instead, add "*" to the list of unary operators kernel-doc recognizes
> and make the form of *@param available in kernel-doc comments.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Link: [1] https://lore.kernel.org/r/20240223153636.41358be5@canb.auug.org.au/
> Acked-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> ---
> Note for Chandan
>
> As both of patches 1/2 and 2/2 are needed to resolve the warning from
> Sphinx which commit d7468609ee0f ("shmem: export shmem_get_folio") in
> the xfs tree introduced, I'd like you to pick them up.

This change seems fine to me; I can't make it break anything.  I can't
apply the mm patch, so either they both get picked up on the other side
or we split them (which we could do, nothing would be any more broken
that way).  For the former case:

Acked-by: Jonathan Corbet <corbet@lwn.net>

Thanks,

jon


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

* Re: [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref
  2024-02-28 22:40 ` [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Jonathan Corbet
@ 2024-02-28 23:47   ` Darrick J. Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2024-02-28 23:47 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Akira Yokosawa, Chandan Babu R, Christoph Hellwig,
	Mauro Carvalho Chehab, Stephen Rothwell, Andrew Morton,
	linux-xfs, linux-mm

On Wed, Feb 28, 2024 at 03:40:05PM -0700, Jonathan Corbet wrote:
> Akira Yokosawa <akiyks@gmail.com> writes:
> 
> > In kernel-doc comments, unary operator * collides with Sphinx/
> > docutil's markdown for emphasizing.
> >
> > This resulted in additional warnings from "make htmldocs":
> >
> >     WARNING: Inline emphasis start-string without end-string.
> >
> > , as reported recently [1].
> >
> > Those have been worked around either by escaping * (like \*param) or by
> > using inline-literal form of ``*param``, both of which are specific
> > to Sphinx/docutils.
> >
> > Such workarounds are against the kenrel-doc's ideal and should better
> > be avoided.
> >
> > Instead, add "*" to the list of unary operators kernel-doc recognizes
> > and make the form of *@param available in kernel-doc comments.
> >
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Link: [1] https://lore.kernel.org/r/20240223153636.41358be5@canb.auug.org.au/
> > Acked-by: Christoph Hellwig <hch@lst.de>
> > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> > ---
> > Note for Chandan
> >
> > As both of patches 1/2 and 2/2 are needed to resolve the warning from
> > Sphinx which commit d7468609ee0f ("shmem: export shmem_get_folio") in
> > the xfs tree introduced, I'd like you to pick them up.
> 
> This change seems fine to me; I can't make it break anything.  I can't
> apply the mm patch, so either they both get picked up on the other side
> or we split them (which we could do, nothing would be any more broken
> that way).  For the former case:
> 
> Acked-by: Jonathan Corbet <corbet@lwn.net>

Seeing as the changes came through the XFS tree, I second the notion of
pushing this via the xfs for-next.

--D

> Thanks,
> 
> jon
> 


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

end of thread, other threads:[~2024-02-28 23:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27  5:03 [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Akira Yokosawa
2024-02-27  5:06 ` [PATCH 2/2] mm/shmem.c: Use new form of *@param in kernel-doc Akira Yokosawa
2024-02-28 22:40 ` [PATCH 1/2] kernel-doc: Add unary operator * to $type_param_ref Jonathan Corbet
2024-02-28 23:47   ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox