Skip to content

Commit ce2e33b

Browse files
committed
Merge tag 'docs-5.10-3' of git://git.lwn.net/linux
Pull documentation fixes from Jonathan Corbet: "A small number of fixes, plus a build tweak to respect the desire for silence in V=0 builds" * tag 'docs-5.10-3' of git://git.lwn.net/linux: docs: fix automarkup regression on Python 2 documentation: arm: sunxi: add Allwinner H6 documents scripts: kernel-doc: split typedef complex regex scripts: kernel-doc: fix typedef parsing docs: Makefile: honor V=0 for docs building
2 parents 43c8341 + 4f3e690 commit ce2e33b

4 files changed

Lines changed: 38 additions & 11 deletions

File tree

Documentation/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ BUILDDIR = $(obj)/output
2626
PDFLATEX = xelatex
2727
LATEXOPTS = -interaction=batchmode
2828

29+
ifeq ($(KBUILD_VERBOSE),0)
30+
SPHINXOPTS += "-q"
31+
endif
32+
2933
# User-friendly check for sphinx-build
3034
HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi)
3135

Documentation/arm/sunxi.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,13 @@ SunXi family
148148
* User Manual
149149

150150
http://dl.linux-sunxi.org/A64/Allwinner%20A64%20User%20Manual%20v1.0.pdf
151+
152+
- Allwinner H6
153+
154+
* Datasheet
155+
156+
https://linux-sunxi.org/images/5/5c/Allwinner_H6_V200_Datasheet_V1.1.pdf
157+
158+
* User Manual
159+
160+
https://linux-sunxi.org/images/4/46/Allwinner_H6_V200_User_Manual_V1.1.pdf

Documentation/sphinx/automarkup.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,37 @@
1515
import re
1616
from itertools import chain
1717

18+
#
19+
# Python 2 lacks re.ASCII...
20+
#
21+
try:
22+
ascii_p3 = re.ASCII
23+
except AttributeError:
24+
ascii_p3 = 0
25+
1826
#
1927
# Regex nastiness. Of course.
2028
# Try to identify "function()" that's not already marked up some
2129
# other way. Sphinx doesn't like a lot of stuff right after a
2230
# :c:func: block (i.e. ":c:func:`mmap()`s" flakes out), so the last
2331
# bit tries to restrict matches to things that won't create trouble.
2432
#
25-
RE_function = re.compile(r'\b(([a-zA-Z_]\w+)\(\))', flags=re.ASCII)
33+
RE_function = re.compile(r'\b(([a-zA-Z_]\w+)\(\))', flags=ascii_p3)
2634

2735
#
2836
# Sphinx 2 uses the same :c:type role for struct, union, enum and typedef
2937
#
3038
RE_generic_type = re.compile(r'\b(struct|union|enum|typedef)\s+([a-zA-Z_]\w+)',
31-
flags=re.ASCII)
39+
flags=ascii_p3)
3240

3341
#
3442
# Sphinx 3 uses a different C role for each one of struct, union, enum and
3543
# typedef
3644
#
37-
RE_struct = re.compile(r'\b(struct)\s+([a-zA-Z_]\w+)', flags=re.ASCII)
38-
RE_union = re.compile(r'\b(union)\s+([a-zA-Z_]\w+)', flags=re.ASCII)
39-
RE_enum = re.compile(r'\b(enum)\s+([a-zA-Z_]\w+)', flags=re.ASCII)
40-
RE_typedef = re.compile(r'\b(typedef)\s+([a-zA-Z_]\w+)', flags=re.ASCII)
45+
RE_struct = re.compile(r'\b(struct)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
46+
RE_union = re.compile(r'\b(union)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
47+
RE_enum = re.compile(r'\b(enum)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
48+
RE_typedef = re.compile(r'\b(typedef)\s+([a-zA-Z_]\w+)', flags=ascii_p3)
4149

4250
#
4351
# Detects a reference to a documentation page of the form Documentation/... with

scripts/kernel-doc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,20 +1427,25 @@ sub dump_enum($$) {
14271427
}
14281428
}
14291429

1430+
my $typedef_type = qr { ((?:\s+[\w\*]+){1,8})\s* }x;
1431+
my $typedef_ident = qr { \*?\s*(\w\S+)\s* }x;
1432+
my $typedef_args = qr { \s*\((.*)\); }x;
1433+
1434+
my $typedef1 = qr { typedef$typedef_type\($typedef_ident\)$typedef_args }x;
1435+
my $typedef2 = qr { typedef$typedef_type$typedef_ident$typedef_args }x;
1436+
14301437
sub dump_typedef($$) {
14311438
my $x = shift;
14321439
my $file = shift;
14331440

14341441
$x =~ s@/\*.*?\*/@@gos; # strip comments.
14351442

1436-
# Parse function prototypes
1437-
if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ ||
1438-
$x =~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) {
1439-
1440-
# Function typedefs
1443+
# Parse function typedef prototypes
1444+
if ($x =~ $typedef1 || $x =~ $typedef2) {
14411445
$return_type = $1;
14421446
$declaration_name = $2;
14431447
my $args = $3;
1448+
$return_type =~ s/^\s+//;
14441449

14451450
create_parameterlist($args, ',', $file, $declaration_name);
14461451

0 commit comments

Comments
 (0)