Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
1081de2d 8ad72163

+4 -15
+4 -15
scripts/kernel-doc
··· 1003 1003 sub dump_struct($$) { 1004 1004 my $x = shift; 1005 1005 my $file = shift; 1006 - my $nested; 1007 1006 1008 1007 if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) { 1009 1008 my $decl_type = $1; ··· 1062 1063 1063 1064 # Ignore other nested elements, like enums 1064 1065 $members =~ s/({[^\{\}]*})//g; 1065 - $nested = $decl_type; 1066 - $nested =~ s/\/\*.*?\*\///gos; 1067 1066 1068 1067 create_parameterlist($members, ';', $file); 1069 - check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual, $nested); 1068 + check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual); 1070 1069 1071 1070 # Adjust declaration for better display 1072 1071 $declaration =~ s/([{;])/$1\n/g; ··· 1369 1372 $parametertypes{$param} = $type; 1370 1373 } 1371 1374 1372 - sub check_sections($$$$$$) { 1373 - my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck, $nested) = @_; 1375 + sub check_sections($$$$$) { 1376 + my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck) = @_; 1374 1377 my @sects = split ' ', $sectcheck; 1375 1378 my @prms = split ' ', $prmscheck; 1376 1379 my $err; ··· 1404 1407 "'$sects[$sx]' " . 1405 1408 "description in '$decl_name'\n"; 1406 1409 ++$warnings; 1407 - } else { 1408 - if ($nested !~ m/\Q$sects[$sx]\E/) { 1409 - print STDERR "${file}:$.: warning: " . 1410 - "Excess $decl_type member " . 1411 - "'$sects[$sx]' " . 1412 - "description in '$decl_name'\n"; 1413 - ++$warnings; 1414 - } 1415 1410 } 1416 1411 } 1417 1412 } ··· 1514 1525 } 1515 1526 1516 1527 my $prms = join " ", @parameterlist; 1517 - check_sections($file, $declaration_name, "function", $sectcheck, $prms, ""); 1528 + check_sections($file, $declaration_name, "function", $sectcheck, $prms); 1518 1529 1519 1530 # This check emits a lot of warnings at the moment, because many 1520 1531 # functions don't have a 'Return' doc section. So until the number