aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2007-07-19 04:48:24 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:45 -0400
commit5f8c7c98ae3888cf0a2cf320f514f75cc92f00be (patch)
tree5949c17d2d7a880838602559c01907412438f119 /scripts/kernel-doc
parent2ac534bc127bcf31f8cb76f65b1b0b7cba5e81ac (diff)
kernel-doc: fix unnamed struct/union warning
Fix kernel-doc warning: Warning(linux-2.6.22-rc2-git2/include/linux/skbuff.h:316): No description found for parameter '}' which is caused by nested anonymous structs/unions ending with: }; }; 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/kernel-doc')
-rwxr-xr-xscripts/kernel-doc14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index e5bf649e516..08894f4aab2 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -154,6 +154,7 @@ use strict;
154 154
155my $errors = 0; 155my $errors = 0;
156my $warnings = 0; 156my $warnings = 0;
157my $anon_struct_union = 0;
157 158
158# match expressions used to find embedded type information 159# match expressions used to find embedded type information
159my $type_constant = '\%([-_\w]+)'; 160my $type_constant = '\%([-_\w]+)';
@@ -1510,8 +1511,13 @@ sub push_parameter($$$) {
1510 my $param = shift; 1511 my $param = shift;
1511 my $type = shift; 1512 my $type = shift;
1512 my $file = shift; 1513 my $file = shift;
1513 my $anon = 0;
1514 1514
1515 if (($anon_struct_union == 1) && ($type eq "") &&
1516 ($param eq "}")) {
1517 return; # ignore the ending }; from anon. struct/union
1518 }
1519
1520 $anon_struct_union = 0;
1515 my $param_name = $param; 1521 my $param_name = $param;
1516 $param_name =~ s/\[.*//; 1522 $param_name =~ s/\[.*//;
1517 1523
@@ -1530,16 +1536,16 @@ sub push_parameter($$$) {
1530 # handle unnamed (anonymous) union or struct: 1536 # handle unnamed (anonymous) union or struct:
1531 { 1537 {
1532 $type = $param; 1538 $type = $param;
1533 $param = "{unnamed_" . $param. "}"; 1539 $param = "{unnamed_" . $param . "}";
1534 $parameterdescs{$param} = "anonymous\n"; 1540 $parameterdescs{$param} = "anonymous\n";
1535 $anon = 1; 1541 $anon_struct_union = 1;
1536 } 1542 }
1537 1543
1538 # warn if parameter has no description 1544 # warn if parameter has no description
1539 # (but ignore ones starting with # as these are not parameters 1545 # (but ignore ones starting with # as these are not parameters
1540 # but inline preprocessor statements); 1546 # but inline preprocessor statements);
1541 # also ignore unnamed structs/unions; 1547 # also ignore unnamed structs/unions;
1542 if (!$anon) { 1548 if (!$anon_struct_union) {
1543 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) { 1549 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
1544 1550
1545 $parameterdescs{$param_name} = $undescribed; 1551 $parameterdescs{$param_name} = $undescribed;