mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: mchehab+huawei@kernel.org
Cc: corbet@lwn.net, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, mchehab@kernel.org,
	rdunlap@infradead.org
Subject: Re: [PATCH v4 0/5] kernel-doc: add support for documenting vars
Date: Sun, 23 Nov 2025 20:28:23 +0900	[thread overview]
Message-ID: <dc0540b6-4f48-4d06-b68e-c4cb8be7a52e@gmail.com> (raw)
In-Reply-To: <cover.1763814816.git.mchehab+huawei@kernel.org>

Hi Mauro,

On Sat, 22 Nov 2025 13:37:54 +0100, Mauro Carvalho Chehab wrote:
> Hi Jon,
> 
> As suggested and discussed with Randy, this small series add support
> for documenting variables using kernel-doc.
> 
> - patch 1: add support for the new feature;
> - patch 2: extends to support DEFINE_*;
> - patch 3: document two media vars;
> - patch 4: fix an issue on kernel-doc.rst markups and automarkup;
> - patch 5: document it.
> 
> On this version, I'm using "c:macro" to describe variables, as it
> avoids Sphinx C domain to try parse the variable. This makes it more
> flexible and easier to maintain in long term.

In my test on top of current docs-next, I got two *new* warnings from
"make cleandocs; make htmldocs":

    .../Documentation/driver-api/media/v4l2-common:8: ../include/media/v4l2-ioctl.h:665: WARNING: Inline emphasis start-string without end-string. [docutils]
    .../Documentation/driver-api/media/v4l2-common:8: ../include/media/v4l2-ioctl.h:678: WARNING: Inline emphasis start-string without end-string. [docutils]

"scripts/kernel-doc -rst include/media/v4l2-ioctl.h" emits the following:

    .. c:macro:: v4l2_field_names

=>    extern const char *v4l2_field_names[];

      Helper array mapping V4L2_FIELD_* to strings.

      **Description**

      Specially when printing debug messages, it is interesting to output
      the field order at the V4L2 buffers. This array associates all possible
      values of field pix format from V4L2 API into a string.




    .. c:macro:: v4l2_type_names

=>    extern const char *v4l2_type_names[];

      Helper array mapping V4L2_BUF_TYPE_* to strings.

      **Description**

      When printing debug messages, it is interesting to output the V4L2 buffer
      type number with a name that represents its content.

I think those declaration signatures need to be inline-literal. 

Thanks, Akira

> 
> ---
> 
> v4: 
> - document the new markup;
> - fix an issue on kernel-doc.rst due to automarkup;
> - add support for DEFINE_* macros
> 
> Mauro Carvalho Chehab (5):
>   kernel-doc: add support for handling global variables
>   kernel-doc: add support to handle DEFINE_ variables
>   docs: media: v4l2-ioctl.h: document two global variables
>   docs: kernel-doc.rst: don't let automarkup mangle with consts
>   docs: kernel-doc.rst: document the new "var" kernel-doc markup
> 
>  Documentation/doc-guide/kernel-doc.rst | 48 +++++++++++------
>  include/media/v4l2-ioctl.h             | 15 ++++++
>  tools/lib/python/kdoc/kdoc_output.py   | 46 ++++++++++++++++
>  tools/lib/python/kdoc/kdoc_parser.py   | 73 +++++++++++++++++++++++++-
>  4 files changed, 166 insertions(+), 16 deletions(-)
> 
> -- 
> 2.51.1


      parent reply	other threads:[~2025-11-23 11:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22 12:37 Mauro Carvalho Chehab
2025-11-22 12:37 ` [PATCH v4 1/5] kernel-doc: add support for handling global variables Mauro Carvalho Chehab
2025-11-22 12:37 ` [PATCH v4 2/5] kernel-doc: add support to handle DEFINE_ variables Mauro Carvalho Chehab
2025-11-22 12:37 ` [PATCH v4 3/5] docs: media: v4l2-ioctl.h: document two global variables Mauro Carvalho Chehab
2025-11-22 12:37 ` [PATCH v4 4/5] docs: kernel-doc.rst: don't let automarkup mangle with consts Mauro Carvalho Chehab
2025-11-24  3:41   ` Randy Dunlap
2025-11-22 12:37 ` [PATCH v4 5/5] docs: kernel-doc.rst: document the new "var" kernel-doc markup Mauro Carvalho Chehab
2025-11-23 11:28 ` Akira Yokosawa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc0540b6-4f48-4d06-b68e-c4cb8be7a52e@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®