public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: 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>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/2] doc: kdoc: Handle DEFINE_IDTENTRY_*() cases
Date: Thu,  6 Nov 2025 11:12:25 +0100	[thread overview]
Message-ID: <20251106101416.1924707-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20251106101416.1924707-1-andriy.shevchenko@linux.intel.com>

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)"
+
+        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
             #
-- 
2.50.1


  reply	other threads:[~2025-11-06 10:14 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 ` Andy Shevchenko [this message]
2025-11-07  5:46   ` [PATCH v1 1/2] doc: kdoc: Handle DEFINE_IDTENTRY_*() cases Randy Dunlap
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=20251106101416.1924707-2-andriy.shevchenko@linux.intel.com \
    --to=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