All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Distinguish between errors and warnings in modpost
@ 2006-10-07 11:35 Matthew Wilcox
  2007-03-17  8:33 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2006-10-07 11:35 UTC (permalink / raw)
  To: sam; +Cc: linux-kernel, Matthew Wilcox

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;
 		}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Distinguish between errors and warnings in modpost
  2006-10-07 11:35 [PATCH] Distinguish between errors and warnings in modpost Matthew Wilcox
@ 2007-03-17  8:33 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2007-03-17  8:33 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-kernel

On Sat, Oct 07, 2006 at 05:35:32AM -0600, Matthew Wilcox wrote:
> 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>

Applied - but I named it merror to avoid clash with glibc and
declared it in modpost.h too.

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-17  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-07 11:35 [PATCH] Distinguish between errors and warnings in modpost Matthew Wilcox
2007-03-17  8:33 ` Sam Ravnborg

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.