diff options
author | Richard Kennedy <richard@rsk.demon.co.uk> | 2008-02-23 18:24:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-23 20:12:16 -0500 |
commit | 00d6296145c6b671a9886e380efc24f2731d856a (patch) | |
tree | 2dbef82cc0b1b89d23187ade50ee4042c5bc10b0 /scripts | |
parent | ff10e5dc1781cd0121f8ee936234c222ff15c105 (diff) |
kernel-doc: fix function-pointer-parameter parsing
When running "make htmldocs" I'm seeing some non-fatal perl errors caused
by trying to parse the callback function definitions in blk-core.c.
The errors are "Use of uninitialized value in concatenation (.)..."
in combination with:
Warning(linux-2.6.25-rc2/block/blk-core.c:1877): No description found for parameter ''
The function pointers are defined without a * i.e.
int (drv_callback)(struct request *)
The compiler is happy with them, but kernel-doc isn't.
This patch teaches create_parameterlist in kernel-doc to parse this type of
function pointer definition, but is it the right way to fix the problem ?
The problem only seems to occur in blk-core.c.
However with the patch applied, kernel-doc finds the correct parameter
description for the callback in blk_end_request_callback, which is doesn't
normally.
I thought it would be a bit odd to change to code to use the more normal
form of function pointers just to get the documentation to work, so I fixed
kernel-doc instead - even though this is teaching it to understand code
that might go away (The comment for blk_end_request_callback says that it
should not be used and will removed at some point).
Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kernel-doc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 26146cbaa504..74c2f9db2aac 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1512,13 +1512,13 @@ sub create_parameterlist($$$) { | |||
1512 | # corresponding data structures "correctly". Catch it later in | 1512 | # corresponding data structures "correctly". Catch it later in |
1513 | # output_* subs. | 1513 | # output_* subs. |
1514 | push_parameter($arg, "", $file); | 1514 | push_parameter($arg, "", $file); |
1515 | } elsif ($arg =~ m/\(.*\*/) { | 1515 | } elsif ($arg =~ m/\(.+\)\s*\(/) { |
1516 | # pointer-to-function | 1516 | # pointer-to-function |
1517 | $arg =~ tr/#/,/; | 1517 | $arg =~ tr/#/,/; |
1518 | $arg =~ m/[^\(]+\(\*\s*([^\)]+)\)/; | 1518 | $arg =~ m/[^\(]+\(\*?\s*(\w*)\s*\)/; |
1519 | $param = $1; | 1519 | $param = $1; |
1520 | $type = $arg; | 1520 | $type = $arg; |
1521 | $type =~ s/([^\(]+\(\*)$param/$1/; | 1521 | $type =~ s/([^\(]+\(\*?)\s*$param/$1/; |
1522 | push_parameter($param, $type, $file); | 1522 | push_parameter($param, $type, $file); |
1523 | } elsif ($arg) { | 1523 | } elsif ($arg) { |
1524 | $arg =~ s/\s*:\s*/:/g; | 1524 | $arg =~ s/\s*:\s*/:/g; |