docs: kerneldoc.py: append the name of the parsed doc file
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 28 Sep 2020 09:22:12 +0000 (11:22 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 15 Oct 2020 05:49:37 +0000 (07:49 +0200)
Finding where an error like this was generated:
../lib/math/div64.c:73: WARNING: Duplicate C declaration, also defined in 'kernel-api'.

Can take some time, as there's no glue about what kernel-doc
tag generated it. It is a way better to display it as:

.../Documentation/core-api/kernel-api:171: ../lib/math/div64.c:73: WARNING: Duplicate C declaration, also defined in 'kernel-api'.
Declaration is 'div_s64_rem'.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Documentation/sphinx/kerneldoc.py

index 1a1b122..a3a5427 100644 (file)
@@ -141,7 +141,8 @@ class KernelDocDirective(Directive):
                     lineoffset = int(match.group(1)) - 1
                     # we must eat our comments since the upset the markup
                 else:
-                    result.append(line, filename, lineoffset)
+                    doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno)
+                    result.append(line, doc + ": " + filename, lineoffset)
                     lineoffset += 1
 
             node = nodes.section()