Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f8c7c98 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds
Browse files

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: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2ac534bc
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -154,6 +154,7 @@ use strict;


my $errors = 0;
my $errors = 0;
my $warnings = 0;
my $warnings = 0;
my $anon_struct_union = 0;


# match expressions used to find embedded type information
# match expressions used to find embedded type information
my $type_constant = '\%([-_\w]+)';
my $type_constant = '\%([-_\w]+)';
@@ -1510,8 +1511,13 @@ sub push_parameter($$$) {
	my $param = shift;
	my $param = shift;
	my $type = shift;
	my $type = shift;
	my $file = shift;
	my $file = shift;
	my $anon = 0;


	if (($anon_struct_union == 1) && ($type eq "") &&
	    ($param eq "}")) {
		return;		# ignore the ending }; from anon. struct/union
	}

	$anon_struct_union = 0;
	my $param_name = $param;
	my $param_name = $param;
	$param_name =~ s/\[.*//;
	$param_name =~ s/\[.*//;


@@ -1532,14 +1538,14 @@ sub push_parameter($$$) {
		$type = $param;
		$type = $param;
		$param = "{unnamed_" . $param . "}";
		$param = "{unnamed_" . $param . "}";
		$parameterdescs{$param} = "anonymous\n";
		$parameterdescs{$param} = "anonymous\n";
		$anon = 1;
		$anon_struct_union = 1;
	}
	}


	# warn if parameter has no description
	# warn if parameter has no description
	# (but ignore ones starting with # as these are not parameters
	# (but ignore ones starting with # as these are not parameters
	# but inline preprocessor statements);
	# but inline preprocessor statements);
	# also ignore unnamed structs/unions;
	# also ignore unnamed structs/unions;
	if (!$anon) {
	if (!$anon_struct_union) {
	if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
	if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {


	    $parameterdescs{$param_name} = $undescribed;
	    $parameterdescs{$param_name} = $undescribed;