summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2009-06-18 04:37:47 +0400
committerSam Ravnborg <sam@ravnborg.org>2009-06-20 15:35:01 +0400
commite34e7dbb35474ffc75f639eca64a18a15f4f8688 (patch)
tree6e820754c6b5e22d8dbea1ad0bcc7af7cef6fd43 /scripts
parentb2fd6dbf25cba7d904b62b81639bca8678c901fa (diff)
downloadlinux-e34e7dbb35474ffc75f639eca64a18a15f4f8688.tar.xz
kernel-doc: fix param matching for array params
Fix function actual parameter vs. kernel-doc description matching so that a warning is not printed when it should not be: Warning(include/linux/etherdevice.h:199): Excess function parameter 'addr' description in 'is_etherdev_addr' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kernel-doc17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index fde6e3a22e70..ed591e9b7d1d 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1653,6 +1653,15 @@ sub push_parameter($$$) {
}
}
+ # strip spaces from $param so that it is one continous string
+ # on @parameterlist;
+ # this fixes a problem where check_sections() cannot find
+ # a parameter like "addr[6 + 2]" because it actually appears
+ # as "addr[6", "+", "2]" on the parameter list;
+ # but it's better to maintain the param string unchanged for output,
+ # so just weaken the string compare in check_sections() to ignore
+ # "[blah" in a parameter string;
+ ###$param =~ s/\s*//g;
push @parameterlist, $param;
$parametertypes{$param} = $type;
}
@@ -1671,6 +1680,14 @@ sub check_sections($$$$$$) {
$prm_clean = $prms[$px];
$prm_clean =~ s/\[.*\]//;
$prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//;
+ # ignore array size in a parameter string;
+ # however, the original param string may contain
+ # spaces, e.g.: addr[6 + 2]
+ # and this appears in @prms as "addr[6" since the
+ # parameter list is split at spaces;
+ # hence just ignore "[..." for the sections check;
+ $prm_clean =~ s/\[.*//;
+
##$prm_clean =~ s/^\**//;
if ($prm_clean eq $sects[$sx]) {
$err = 0;