mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH v1 1/2] doc: kdoc: Handle DEFINE_IDTENTRY_*() cases
Date: Thu, 6 Nov 2025 21:46:57 -0800	[thread overview]
Message-ID: <e7a48398-6ea2-458c-bb2d-8142c8086d36@infradead.org> (raw)
In-Reply-To: <20251106101416.1924707-2-andriy.shevchenko@linux.intel.com>

Hi,

On 11/6/25 2:12 AM, Andy Shevchenko wrote:
> We have an unparsed kernel-doc for spurious_interrupt() IDTENTRY.
> Update kdoc to handle that.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  scripts/lib/kdoc/kdoc_parser.py | 27 +++++++++++++++++++++++----
>  1 file changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index f7dbb0868367..b583edd80a52 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -1430,6 +1430,25 @@ class KernelDoc:
>  
>          return proto
>  
> +    def idtentry_munge(self, ln, proto):
> +        """
> +        Handle DEFINE_IDTENTRY_*() definitions
> +        """
> +
> +        name = None
> +
> +        # Replace DEFINE_IDTENTRY_IRQ with correct return type & function name
> +        r = KernRe(r'DEFINE_IDTENTRY_IRQ\((.*?)\)')
> +        if r.search(proto):
> +            name = r.group(1)
> +
> +        if not name:
> +            self.emit_msg(ln, f"Unrecognized IDTENTRY format:\n{proto}\n")
> +        else:
> +            proto = f"static inline void {name}((struct pt_regs *regs, unsigned long error_code)"

Seems to be an extra '(' here ...................^^^

Oh, weird: is the comma inside function parameters converted to a '#' somewhere?
See below in SYNOPSIS.


Output from testing says: (-man format output)

NAME
       spurious_interrupt - Catch all for interrupts raised on unused vectors

SYNOPSIS
       void spurious_interrupt ((struct pt_regs *regs# unsigned long error_code
       );

ARGUMENTS
       error_code  The vector number

> +
> +        return proto
> +
>      def tracepoint_munge(self, ln, proto):
>          """
>          Handle tracepoint definitions
> @@ -1499,13 +1518,13 @@ class KernelDoc:
>              # Handle special declaration syntaxes
>              #
>              if 'SYSCALL_DEFINE' in self.entry.prototype:
> -                self.entry.prototype = self.syscall_munge(ln,
> -                                                          self.entry.prototype)
> +                self.entry.prototype = self.syscall_munge(ln, self.entry.prototype)
> +            elif 'DEFINE_IDTENTRY' in self.entry.prototype:
> +                self.entry.prototype = self.idtentry_munge(ln, self.entry.prototype)
>              else:
>                  r = KernRe(r'TRACE_EVENT|DEFINE_EVENT|DEFINE_SINGLE_EVENT')
>                  if r.search(self.entry.prototype):
> -                    self.entry.prototype = self.tracepoint_munge(ln,
> -                                                                 self.entry.prototype)
> +                    self.entry.prototype = self.tracepoint_munge(ln, self.entry.prototype)
>              #
>              # ... and we're done
>              #

-- 
~Randy


  reply	other threads:[~2025-11-07  5:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 10:12 [PATCH v1 0/2] doc: Handle IDTENTRY and fix apic.c Andy Shevchenko
2025-11-06 10:12 ` [PATCH v1 1/2] doc: kdoc: Handle DEFINE_IDTENTRY_*() cases Andy Shevchenko
2025-11-07  5:46   ` Randy Dunlap [this message]
2025-11-06 10:12 ` [PATCH v1 2/2] x86/apic: Update kernel-doc to avoid warnings Andy Shevchenko
2025-11-08  0:47   ` Randy Dunlap

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=e7a48398-6ea2-458c-bb2d-8142c8086d36@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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®