From b30df2751e581ea24999ff2263df99208b8e3ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 23 Mar 2021 16:52:47 +0000 Subject: [PATCH] scripts/kernel-doc: strip QEMU_ from function definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some packaged versions of Sphinx (fedora33/alpine so far) have issues with the annotated C code that kernel-doc spits out. Without knowing about things like QEMU_PLUGIN_EXPORT it chokes trying to understand the code. Evidently this is a problem for the kernel as well as the long stream of regex substitutions we add to in this patch can attest. Fortunately we have a fairly common format for all our compiler shenanigans as applied to functions so lets just filter them all out. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210323165308.15244-2-alex.bennee@linaro.org> --- scripts/kernel-doc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4b19851b2d..240923d509 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1745,6 +1745,9 @@ sub dump_function($$) { )+ \)\)\s+//x; + # Strip QEMU specific compiler annotations + $prototype =~ s/QEMU_[A-Z_]+ +//; + # Yes, this truly is vile. We are looking for: # 1. Return type (may be nothing if we're looking at a macro) # 2. Function name