Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f8c7c98ae3888cf0a2cf320f514f75cc92f00be
Commit:     5f8c7c98ae3888cf0a2cf320f514f75cc92f00be
Parent:     2ac534bc127bcf31f8cb76f65b1b0b7cba5e81ac
Author:     Randy Dunlap <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 19 01:48:24 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 10:04:45 2007 -0700

    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: Randy Dunlap <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 scripts/kernel-doc |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index e5bf649..08894f4 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -154,6 +154,7 @@ use strict;
 
 my $errors = 0;
 my $warnings = 0;
+my $anon_struct_union = 0;
 
 # match expressions used to find embedded type information
 my $type_constant = '\%([-_\w]+)';
@@ -1510,8 +1511,13 @@ sub push_parameter($$$) {
        my $param = shift;
        my $type = 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;
        $param_name =~ s/\[.*//;
 
@@ -1530,16 +1536,16 @@ sub push_parameter($$$) {
        # handle unnamed (anonymous) union or struct:
        {
                $type = $param;
-               $param = "{unnamed_" . $param. "}";
+               $param = "{unnamed_" . $param . "}";
                $parameterdescs{$param} = "anonymous\n";
-               $anon = 1;
+               $anon_struct_union = 1;
        }
 
        # warn if parameter has no description
        # (but ignore ones starting with # as these are not parameters
        # but inline preprocessor statements);
        # also ignore unnamed structs/unions;
-       if (!$anon) {
+       if (!$anon_struct_union) {
        if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
 
            $parameterdescs{$param_name} = $undescribed;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to