aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 07:30:14 -0500
committerJonathan Corbet <corbet@lwn.net>2017-12-21 15:41:46 -0500
commit1081de2d2f9179d7280926e37b7b22b4f2fb32e6 (patch)
treeb328355a3f6697be2c13af0d4077f270528f5337 /scripts/kernel-doc
parent8ad72163165265b686902c182c1b4a913e738a81 (diff)
scripts: kernel-doc: get rid of $nested parameter
The check_sections() function has a $nested parameter, meant to identify when a nested struct is present. As we now have a logic that handles it, get rid of such parameter. Suggested-by: Markus Heiser <markus.heiser@darmarit.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc19
1 files changed, 4 insertions, 15 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index b0eb1cd6afbe..fadb832733d9 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1003,7 +1003,6 @@ sub dump_union($$) {
1003sub dump_struct($$) { 1003sub dump_struct($$) {
1004 my $x = shift; 1004 my $x = shift;
1005 my $file = shift; 1005 my $file = shift;
1006 my $nested;
1007 1006
1008 if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) { 1007 if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
1009 my $decl_type = $1; 1008 my $decl_type = $1;
@@ -1063,11 +1062,9 @@ sub dump_struct($$) {
1063 1062
1064 # Ignore other nested elements, like enums 1063 # Ignore other nested elements, like enums
1065 $members =~ s/({[^\{\}]*})//g; 1064 $members =~ s/({[^\{\}]*})//g;
1066 $nested = $decl_type;
1067 $nested =~ s/\/\*.*?\*\///gos;
1068 1065
1069 create_parameterlist($members, ';', $file); 1066 create_parameterlist($members, ';', $file);
1070 check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual, $nested); 1067 check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual);
1071 1068
1072 # Adjust declaration for better display 1069 # Adjust declaration for better display
1073 $declaration =~ s/([{;])/$1\n/g; 1070 $declaration =~ s/([{;])/$1\n/g;
@@ -1372,8 +1369,8 @@ sub push_parameter($$$) {
1372 $parametertypes{$param} = $type; 1369 $parametertypes{$param} = $type;
1373} 1370}
1374 1371
1375sub check_sections($$$$$$) { 1372sub check_sections($$$$$) {
1376 my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck, $nested) = @_; 1373 my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck) = @_;
1377 my @sects = split ' ', $sectcheck; 1374 my @sects = split ' ', $sectcheck;
1378 my @prms = split ' ', $prmscheck; 1375 my @prms = split ' ', $prmscheck;
1379 my $err; 1376 my $err;
@@ -1407,14 +1404,6 @@ sub check_sections($$$$$$) {
1407 "'$sects[$sx]' " . 1404 "'$sects[$sx]' " .
1408 "description in '$decl_name'\n"; 1405 "description in '$decl_name'\n";
1409 ++$warnings; 1406 ++$warnings;
1410 } else {
1411 if ($nested !~ m/\Q$sects[$sx]\E/) {
1412 print STDERR "${file}:$.: warning: " .
1413 "Excess $decl_type member " .
1414 "'$sects[$sx]' " .
1415 "description in '$decl_name'\n";
1416 ++$warnings;
1417 }
1418 } 1407 }
1419 } 1408 }
1420 } 1409 }
@@ -1525,7 +1514,7 @@ sub dump_function($$) {
1525 } 1514 }
1526 1515
1527 my $prms = join " ", @parameterlist; 1516 my $prms = join " ", @parameterlist;
1528 check_sections($file, $declaration_name, "function", $sectcheck, $prms, ""); 1517 check_sections($file, $declaration_name, "function", $sectcheck, $prms);
1529 1518
1530 # This check emits a lot of warnings at the moment, because many 1519 # This check emits a lot of warnings at the moment, because many
1531 # functions don't have a 'Return' doc section. So until the number 1520 # functions don't have a 'Return' doc section. So until the number