public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source
@ 2025-10-01 14:13 Mauro Carvalho Chehab
  2025-10-01 14:13 ` [PATCH 1/1] kernel-doc: output source file name at SEE ALSO Mauro Carvalho Chehab
  2025-10-01 15:06 ` [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2025-10-01 14:13 UTC (permalink / raw)
  To: Jonathan Corbet, Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, linux-kernel

It is interesting to point to what Kernel file contains documented
item at kernel-doc man pages.

Mauro Carvalho Chehab (1):
  kernel-doc: output source file name at SEE ALSO

 scripts/lib/kdoc/kdoc_item.py   | 3 ++-
 scripts/lib/kdoc/kdoc_output.py | 3 ++-
 scripts/lib/kdoc/kdoc_parser.py | 8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

-- 
2.51.0


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

* [PATCH 1/1] kernel-doc: output source file name at SEE ALSO
  2025-10-01 14:13 [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source Mauro Carvalho Chehab
@ 2025-10-01 14:13 ` Mauro Carvalho Chehab
  2025-10-01 15:06 ` [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2025-10-01 14:13 UTC (permalink / raw)
  To: Jonathan Corbet, Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, linux-kernel

for man pages, it is helpful to know from where the man page
were generated.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 scripts/lib/kdoc/kdoc_item.py   | 3 ++-
 scripts/lib/kdoc/kdoc_output.py | 3 ++-
 scripts/lib/kdoc/kdoc_parser.py | 8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/kdoc/kdoc_item.py b/scripts/lib/kdoc/kdoc_item.py
index b3b225764550..19805301cb2c 100644
--- a/scripts/lib/kdoc/kdoc_item.py
+++ b/scripts/lib/kdoc/kdoc_item.py
@@ -5,8 +5,9 @@
 #
 
 class KdocItem:
-    def __init__(self, name, type, start_line, **other_stuff):
+    def __init__(self, name, fname, type, start_line, **other_stuff):
         self.name = name
+        self.fname = fname
         self.type = type
         self.declaration_start_line = start_line
         self.sections = {}
diff --git a/scripts/lib/kdoc/kdoc_output.py b/scripts/lib/kdoc/kdoc_output.py
index 1eca9a918558..58f115059e93 100644
--- a/scripts/lib/kdoc/kdoc_output.py
+++ b/scripts/lib/kdoc/kdoc_output.py
@@ -630,10 +630,11 @@ class ManFormat(OutputFormat):
         """Adds a tail for all man pages"""
 
         # SEE ALSO section
+        self.data += f'.SH "SEE ALSO"' + "\n.PP\n"
+        self.data += (f"Kernel file \\fB{args.fname}\\fR\n")
         if len(self.symbols) >= 2:
             cur_name = self.arg_name(args, name)
 
-            self.data += f'.SH "SEE ALSO"' + "\n.PP\n"
             related = []
             for arg in self.symbols:
                 out_name = self.arg_name(arg, arg.name)
diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index 89d920e0b65c..6e5c115cbdf3 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -254,8 +254,9 @@ SECTION_DEFAULT = "Description"  # default section
 
 class KernelEntry:
 
-    def __init__(self, config, ln):
+    def __init__(self, config, fname, ln):
         self.config = config
+        self.fname = fname
 
         self._contents = []
         self.prototype = ""
@@ -422,7 +423,8 @@ class KernelDoc:
         The actual output and output filters will be handled elsewhere
         """
 
-        item = KdocItem(name, dtype, self.entry.declaration_start_line, **args)
+        item = KdocItem(name, self.fname, dtype,
+                        self.entry.declaration_start_line, **args)
         item.warnings = self.entry.warnings
 
         # Drop empty sections
@@ -445,7 +447,7 @@ class KernelDoc:
         variables used by the state machine.
         """
 
-        self.entry = KernelEntry(self.config, ln)
+        self.entry = KernelEntry(self.config, self.fname, ln)
 
         # State flags
         self.state = state.NORMAL
-- 
2.51.0


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

* Re: [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source
  2025-10-01 14:13 [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source Mauro Carvalho Chehab
  2025-10-01 14:13 ` [PATCH 1/1] kernel-doc: output source file name at SEE ALSO Mauro Carvalho Chehab
@ 2025-10-01 15:06 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2025-10-01 15:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, linux-kernel

Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:

> It is interesting to point to what Kernel file contains documented
> item at kernel-doc man pages.
>
> Mauro Carvalho Chehab (1):
>   kernel-doc: output source file name at SEE ALSO
>
>  scripts/lib/kdoc/kdoc_item.py   | 3 ++-
>  scripts/lib/kdoc/kdoc_output.py | 3 ++-
>  scripts/lib/kdoc/kdoc_parser.py | 8 +++++---
>  3 files changed, 9 insertions(+), 5 deletions(-)

Applied (to build-script), thanks.

jon

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

end of thread, other threads:[~2025-10-01 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 14:13 [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source Mauro Carvalho Chehab
2025-10-01 14:13 ` [PATCH 1/1] kernel-doc: output source file name at SEE ALSO Mauro Carvalho Chehab
2025-10-01 15:06 ` [PATCH 0/1] man pages: Add a SEE ALSO pointing to Kernel source Jonathan Corbet

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