aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kernel-doc14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index e5bf649e516a..08894f4aab2c 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;