]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-5.10/scripts-kernel-doc-fix-syntax-error-due-to-undeclared-args-variable.patch
5.10-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.10 / scripts-kernel-doc-fix-syntax-error-due-to-undeclared-args-variable.patch
CommitLineData
627e3360
GKH
1From ccddb9f4915f0dbf28fb72b6ff4c04977978ed3d Mon Sep 17 00:00:00 2001
2From: Salvatore Bonaccorso <carnil@debian.org>
3Date: Mon, 4 Mar 2024 22:24:12 +0100
4Subject: scripts: kernel-doc: Fix syntax error due to undeclared args variable
5
6From: Salvatore Bonaccorso <carnil@debian.org>
7
8The backport of commit 3080ea5553cc ("stddef: Introduce
9DECLARE_FLEX_ARRAY() helper") to 5.10.y (as a prerequisite of another
10fix) modified scripts/kernel-doc and introduced a syntax error:
11
12Global symbol "$args" requires explicit package name (did you forget to declare "my $args"?) at ./scripts/kernel-doc line 1236.
13Global symbol "$args" requires explicit package name (did you forget to declare "my $args"?) at ./scripts/kernel-doc line 1236.
14Execution of ./scripts/kernel-doc aborted due to compilation errors.
15
16Note: The issue could be fixed in the 5.10.y series as well by
17backporting e86bdb24375a ("scripts: kernel-doc: reduce repeated regex
18expressions into variables") but just replacing the undeclared args back
19to ([^,)]+) was the most straightforward approach. The issue is specific
20to the backport to the 5.10.y series. Thus there is as well no upstream
21commit for this change.
22
23Fixes: 443b16ee3d9c ("stddef: Introduce DECLARE_FLEX_ARRAY() helper") # 5.10.y
24Reported-by: Ben Hutchings <ben@decadent.org.uk>
25Link: https://lore.kernel.org/regressions/ZeHKjjPGoyv_b2Tg@eldamar.lan/T/#u
26Link: https://bugs.debian.org/1064035
27Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 scripts/kernel-doc | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33--- a/scripts/kernel-doc
34+++ b/scripts/kernel-doc
35@@ -1233,7 +1233,7 @@ sub dump_struct($$) {
36 # replace DECLARE_KFIFO_PTR
37 $members =~ s/DECLARE_KFIFO_PTR\s*\(([^,)]+),\s*([^,)]+)\)/$2 \*$1/gos;
38 # replace DECLARE_FLEX_ARRAY
39- $members =~ s/(?:__)?DECLARE_FLEX_ARRAY\s*\($args,\s*$args\)/$1 $2\[\]/gos;
40+ $members =~ s/(?:__)?DECLARE_FLEX_ARRAY\s*\(([^,)]+),\s*([^,)]+)\)/$1 $2\[\]/gos;
41 my $declaration = $members;
42
43 # Split nested struct/union elements as newer ones