diff options
| author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-22 10:46:36 -0400 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2016-07-22 17:34:24 -0400 |
| commit | a88b1672d4ddf9895eb53e6980926d5e960dea8e (patch) | |
| tree | c9efd790bffc3b431d3e7b708a85fcf584e20e98 /scripts/kernel-doc | |
| parent | 29310a50752de76314f51555b72044d11f6cba49 (diff) | |
doc-rst: kernel-doc: fix handling of address_space tags
The RST cpp:function handler is very pedantic: it doesn't allow any
macros like __user on it:
Documentation/media/kapi/dtv-core.rst:28: WARNING: Error when parsing function declaration.
If the function has no return type:
Error in declarator or parameters and qualifiers
Invalid definition: Expecting "(" in parameters_and_qualifiers. [error at 8]
ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len)
--------^
If the function has a return type:
Error in declarator or parameters and qualifiers
If pointer to member declarator:
Invalid definition: Expected '::' in pointer to member (function). [error at 37]
ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len)
-------------------------------------^
If declarator-id:
Invalid definition: Expecting "," or ")" in parameters_and_qualifiers, got "*". [error at 102]
ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, size_t idx, int offset, u8 __user * buf, size_t len)
------------------------------------------------------------------------------------------------------^
So, we have to remove it from the function prototype.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 7388e88a1f50..4f2e9049e8fa 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -1848,6 +1848,10 @@ sub output_function_rst(%) { | |||
| 1848 | } | 1848 | } |
| 1849 | $count++; | 1849 | $count++; |
| 1850 | $type = $args{'parametertypes'}{$parameter}; | 1850 | $type = $args{'parametertypes'}{$parameter}; |
| 1851 | |||
| 1852 | # RST doesn't like address_space tags at function prototypes | ||
| 1853 | $type =~ s/__(user|kernel|iomem|percpu|pmem|rcu)\s*//; | ||
| 1854 | |||
| 1851 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { | 1855 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
| 1852 | # pointer-to-function | 1856 | # pointer-to-function |
| 1853 | print $1 . $parameter . ") (" . $2; | 1857 | print $1 . $parameter . ") (" . $2; |
