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

Commit 134fe01b authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds
Browse files

[PATCH] kernel-doc: allow unnamed structs/unions



Make kernel-doc support unnamed (anonymous) structs and unions.  There is
one (union) in include/linux/skbuff.h (inside struct sk_buff) that is
currently generating a kernel-doc warning, so this fixes that warning.

Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 01b2d93c
Loading
Loading
Loading
Loading
+15 −2
Original line number Original line Diff line number Diff line
@@ -1469,6 +1469,7 @@ sub push_parameter($$$) {
	my $param = shift;
	my $param = shift;
	my $type = shift;
	my $type = shift;
	my $file = shift;
	my $file = shift;
	my $anon = 0;


	my $param_name = $param;
	my $param_name = $param;
	$param_name =~ s/\[.*//;
	$param_name =~ s/\[.*//;
@@ -1484,9 +1485,20 @@ sub push_parameter($$$) {
	    $param="void";
	    $param="void";
	    $parameterdescs{void} = "no arguments";
	    $parameterdescs{void} = "no arguments";
	}
	}
	elsif ($type eq "" && ($param eq "struct" or $param eq "union"))
	# handle unnamed (anonymous) union or struct:
	{
		$type = $param;
		$param = "{unnamed_" . $param. "}";
		$parameterdescs{$param} = "anonymous\n";
		$anon = 1;
	}

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


	    $parameterdescs{$param_name} = $undescribed;
	    $parameterdescs{$param_name} = $undescribed;
@@ -1500,6 +1512,7 @@ sub push_parameter($$$) {
	                 " No description found for parameter '$param'\n";
	                 " No description found for parameter '$param'\n";
	    ++$warnings;
	    ++$warnings;
        }
        }
        }


	push @parameterlist, $param;
	push @parameterlist, $param;
	$parametertypes{$param} = $type;
	$parametertypes{$param} = $type;