[PATCH] kernel-doc: Count enum warnings for -Werror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Warnings about enum members were shown but not counted for -Werror, fix
by adding a few more increments.

Also fix a misindented line.

Signed-off-by: Leonard Crestez <cdleonard@xxxxxxxxx>
---
 scripts/kernel-doc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index cfcb60737957..1f22daafe44c 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1425,10 +1425,11 @@ sub dump_enum($$) {
 	    if ($identifier eq "") {
 		print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n";
 	    } else {
 		print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n";
 	    }
+	    ++$warnings;
 	    return;
 	}
 	$declaration_name = "(anonymous)" if ($declaration_name eq "");
 
 	my %_members;
@@ -1440,19 +1441,21 @@ sub dump_enum($$) {
 	    push @parameterlist, $arg;
 	    if (!$parameterdescs{$arg}) {
 		$parameterdescs{$arg} = $undescribed;
 	        if (show_warnings("enum", $declaration_name)) {
 			print STDERR "${file}:$.: warning: Enum value '$arg' not described in enum '$declaration_name'\n";
+			++$warnings;
 		}
 	    }
 	    $_members{$arg} = 1;
 	}
 
 	while (my ($k, $v) = each %parameterdescs) {
 	    if (!exists($_members{$k})) {
 	        if (show_warnings("enum", $declaration_name)) {
-		     print STDERR "${file}:$.: warning: Excess enum value '$k' description in '$declaration_name'\n";
+		    print STDERR "${file}:$.: warning: Excess enum value '$k' description in '$declaration_name'\n";
+		    ++$warnings;
 		}
 	    }
         }
 
 	output_declaration($declaration_name,
-- 
2.25.1




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux