aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2009-06-17 20:37:47 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-06-20 07:35:01 -0400
commite34e7dbb35474ffc75f639eca64a18a15f4f8688 (patch)
tree6e820754c6b5e22d8dbea1ad0bcc7af7cef6fd43 /scripts
parentb2fd6dbf25cba7d904b62b81639bca8678c901fa (diff)
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($$$) {
1653 } 1653 }
1654 } 1654 }
1655 1655
1656 # strip spaces from $param so that it is one continous string
1657 # on @parameterlist;
1658 # this fixes a problem where check_sections() cannot find
1659 # a parameter like "addr[6 + 2]" because it actually appears
1660 # as "addr[6", "+", "2]" on the parameter list;
1661 # but it's better to maintain the param string unchanged for output,
1662 # so just weaken the string compare in check_sections() to ignore
1663 # "[blah" in a parameter string;
1664 ###$param =~ s/\s*//g;
1656 push @parameterlist, $param; 1665 push @parameterlist, $param;
1657 $parametertypes{$param} = $type; 1666 $parametertypes{$param} = $type;
1658} 1667}
@@ -1671,6 +1680,14 @@ sub check_sections($$$$$$) {
1671 $prm_clean = $prms[$px]; 1680 $prm_clean = $prms[$px];
1672 $prm_clean =~ s/\[.*\]//; 1681 $prm_clean =~ s/\[.*\]//;
1673 $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//; 1682 $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//;
1683 # ignore array size in a parameter string;
1684 # however, the original param string may contain
1685 # spaces, e.g.: addr[6 + 2]
1686 # and this appears in @prms as "addr[6" since the
1687 # parameter list is split at spaces;
1688 # hence just ignore "[..." for the sections check;
1689 $prm_clean =~ s/\[.*//;
1690
1674 ##$prm_clean =~ s/^\**//; 1691 ##$prm_clean =~ s/^\**//;
1675 if ($prm_clean eq $sects[$sx]) { 1692 if ($prm_clean eq $sects[$sx]) {
1676 $err = 0; 1693 $err = 0;