linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel-doc: Count enum warnings for -Werror
@ 2021-09-23 20:01 Leonard Crestez
  0 siblings, 0 replies; only message in thread
From: Leonard Crestez @ 2021-09-23 20:01 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Aditya Srivastava, linux-doc, linux-kernel

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-23 20:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 20:01 [PATCH] kernel-doc: Count enum warnings for -Werror Leonard Crestez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).