]>
Commit | Line | Data |
---|---|---|
627e3360 GKH |
1 | From ccddb9f4915f0dbf28fb72b6ff4c04977978ed3d Mon Sep 17 00:00:00 2001 |
2 | From: Salvatore Bonaccorso <carnil@debian.org> | |
3 | Date: Mon, 4 Mar 2024 22:24:12 +0100 | |
4 | Subject: scripts: kernel-doc: Fix syntax error due to undeclared args variable | |
5 | ||
6 | From: Salvatore Bonaccorso <carnil@debian.org> | |
7 | ||
8 | The backport of commit 3080ea5553cc ("stddef: Introduce | |
9 | DECLARE_FLEX_ARRAY() helper") to 5.10.y (as a prerequisite of another | |
10 | fix) modified scripts/kernel-doc and introduced a syntax error: | |
11 | ||
12 | Global symbol "$args" requires explicit package name (did you forget to declare "my $args"?) at ./scripts/kernel-doc line 1236. | |
13 | Global symbol "$args" requires explicit package name (did you forget to declare "my $args"?) at ./scripts/kernel-doc line 1236. | |
14 | Execution of ./scripts/kernel-doc aborted due to compilation errors. | |
15 | ||
16 | Note: The issue could be fixed in the 5.10.y series as well by | |
17 | backporting e86bdb24375a ("scripts: kernel-doc: reduce repeated regex | |
18 | expressions into variables") but just replacing the undeclared args back | |
19 | to ([^,)]+) was the most straightforward approach. The issue is specific | |
20 | to the backport to the 5.10.y series. Thus there is as well no upstream | |
21 | commit for this change. | |
22 | ||
23 | Fixes: 443b16ee3d9c ("stddef: Introduce DECLARE_FLEX_ARRAY() helper") # 5.10.y | |
24 | Reported-by: Ben Hutchings <ben@decadent.org.uk> | |
25 | Link: https://lore.kernel.org/regressions/ZeHKjjPGoyv_b2Tg@eldamar.lan/T/#u | |
26 | Link: https://bugs.debian.org/1064035 | |
27 | Signed-off-by: Salvatore Bonaccorso <carnil@debian.org> | |
28 | Signed-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 |