The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: sam@ravnborg.org
Cc: linux-kernel@vger.kernel.org, Matthew Wilcox <matthew@wil.cx>
Subject: [PATCH] Distinguish between errors and warnings in modpost
Date: Sat, 07 Oct 2006 05:35:32 -0600	[thread overview]
Message-ID: <11602209321133-git-send-email-matthew@wil.cx> (raw)

Some of modpost's warnings are fatal, and some are not.  Adopt the
compiler distinction between errors and warnings by calling error()
for fatal diagnostics and warn() for non-fatal ones.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 4127796..5530294 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -55,6 +55,17 @@ void warn(const char *fmt, ...)
 	va_end(arglist);
 }
 
+void error(const char *fmt, ...)
+{
+	va_list arglist;
+
+	fprintf(stderr, "ERROR: ");
+
+	va_start(arglist, fmt);
+	vfprintf(stderr, fmt, arglist);
+	va_end(arglist);
+}
+
 static int is_vmlinux(const char *modname)
 {
 	const char *myname;
@@ -1207,9 +1218,14 @@ static int add_versions(struct buffer *b
 		exp = find_symbol(s->name);
 		if (!exp || exp->module == mod) {
 			if (have_vmlinux && !s->weak) {
-				warn("\"%s\" [%s.ko] undefined!\n",
-				     s->name, mod->name);
-				err = warn_unresolved ? 0 : 1;
+				if (warn_unresolved) {
+					warn("\"%s\" [%s.ko] undefined!\n",
+					     s->name, mod->name);
+				} else {
+					error("\"%s\" [%s.ko] undefined!\n",
+					      s->name, mod->name);
+					err = 1;
+				}
 			}
 			continue;
 		}

             reply	other threads:[~2006-10-07 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-07 11:35 Matthew Wilcox [this message]
2007-03-17  8:33 ` [PATCH] Distinguish between errors and warnings in modpost Sam Ravnborg

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=11602209321133-git-send-email-matthew@wil.cx \
    --to=matthew@wil.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox