lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 23 Sep 2021 23:01:12 +0300
From:   Leonard Crestez <cdleonard@...il.com>
To:     Jonathan Corbet <corbet@....net>
Cc:     Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Aditya Srivastava <yashsri421@...il.com>,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] kernel-doc: Count enum warnings for -Werror

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@...il.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

Powered by blists - more mailing lists