All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonard Crestez <cdleonard@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Aditya Srivastava <yashsri421@gmail.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] kernel-doc: Count enum warnings for -Werror
Date: Thu, 23 Sep 2021 23:01:12 +0300	[thread overview]
Message-ID: <46192b4c4ef74b2130333b52a569bfa55f3a7f03.1632427198.git.cdleonard@gmail.com> (raw)

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


                 reply	other threads:[~2021-09-23 20:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46192b4c4ef74b2130333b52a569bfa55f3a7f03.1632427198.git.cdleonard@gmail.com \
    --to=cdleonard@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=yashsri421@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.