linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel-doc: Fix symbol matching for dropped suffixes
@ 2025-06-06 14:15 Matthew Wilcox (Oracle)
  2025-06-07 12:21 ` Mauro Carvalho Chehab
  2025-06-09 20:23 ` Jonathan Corbet
  0 siblings, 2 replies; 5+ messages in thread
From: Matthew Wilcox (Oracle) @ 2025-06-06 14:15 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Matthew Wilcox (Oracle), linux-doc, Mauro Carvalho Chehab,
	Randy Dunlap

The support for dropping "_noprof" missed dropping the suffix from
exported symbols.  That meant that using the :export: feature would
look for kernel-doc for (eg) krealloc_noprof() and not find the
kernel-doc for krealloc().

Fixes: 51a7bf0238c2 (scripts/kernel-doc: drop "_noprof" on function prototypes)
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 scripts/lib/kdoc/kdoc_parser.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index 062453eefc7a..2c6143f7ca0f 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -1171,16 +1171,24 @@ class KernelDoc:
         with a staticmethod decorator.
         """
 
+        # We support documenting some exported symbols with different
+        # names.  A horrible hack.
+        suffixes = [ '_noprof' ]
+
         # Note: it accepts only one EXPORT_SYMBOL* per line, as having
         # multiple export lines would violate Kernel coding style.
 
         if export_symbol.search(line):
             symbol = export_symbol.group(2)
+            for suffix in suffixes:
+                symbol = symbol.removesuffix(suffix)
             function_set.add(symbol)
             return
 
         if export_symbol_ns.search(line):
             symbol = export_symbol_ns.group(2)
+            for suffix in suffixes:
+                symbol = symbol.removesuffix(suffix)
             function_set.add(symbol)
 
     def process_normal(self, ln, line):
-- 
2.47.2


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

end of thread, other threads:[~2025-06-09 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 14:15 [PATCH] kernel-doc: Fix symbol matching for dropped suffixes Matthew Wilcox (Oracle)
2025-06-07 12:21 ` Mauro Carvalho Chehab
2025-06-09 20:23 ` Jonathan Corbet
2025-06-09 20:53   ` Matthew Wilcox
2025-06-09 21:09     ` 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).