public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] modpost: fix trailing comma
@ 2011-03-15 21:13 Randy Dunlap
  2011-03-17 12:39 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2011-03-15 21:13 UTC (permalink / raw)
  To: linux-kbuild; +Cc: lkml, Michal Marek

From: Randy Dunlap <randy.dunlap@oracle.com>

Consolidate locations that print a section whitelist into
calls to print_section_list().

Fix print_section_list() so that it does not print a trailing
comma & space:

If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

becomes:
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 scripts/mod/modpost.c |   23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

--- linux-next-20110315.orig/scripts/mod/modpost.c
+++ linux-next-20110315/scripts/mod/modpost.c
@@ -1248,6 +1248,19 @@ static int is_function(Elf_Sym *sym)
 		return -1;
 }
 
+static void print_section_list(const char * const list[20])
+{
+	const char *const *s = list;
+
+	while (*s) {
+		fprintf(stderr, "%s", *s);
+		s++;
+		if (*s)
+			fprintf(stderr, ", ");
+	}
+	fprintf(stderr, "\n");
+}
+
 /*
  * Print a warning about a section mismatch.
  * Try to find symbols near it so user can find it.
@@ -1304,7 +1317,6 @@ static void report_sec_mismatch(const ch
 		break;
 	case DATA_TO_ANY_INIT: {
 		prl_to = sec2annotation(tosec);
-		const char *const *s = mismatch->symbol_white_list;
 		fprintf(stderr,
 		"The variable %s references\n"
 		"the %s %s%s%s\n"
@@ -1312,9 +1324,7 @@ static void report_sec_mismatch(const ch
 		"variable with __init* or __refdata (see linux/init.h) "
 		"or name the variable:\n",
 		fromsym, to, prl_to, tosym, to_p);
-		while (*s)
-			fprintf(stderr, "%s, ", *s++);
-		fprintf(stderr, "\n");
+		print_section_list(mismatch->symbol_white_list);
 		free(prl_to);
 		break;
 	}
@@ -1329,7 +1339,6 @@ static void report_sec_mismatch(const ch
 		break;
 	case DATA_TO_ANY_EXIT: {
 		prl_to = sec2annotation(tosec);
-		const char *const *s = mismatch->symbol_white_list;
 		fprintf(stderr,
 		"The variable %s references\n"
 		"the %s %s%s%s\n"
@@ -1337,9 +1346,7 @@ static void report_sec_mismatch(const ch
 		"variable with __exit* (see linux/init.h) or "
 		"name the variable:\n",
 		fromsym, to, prl_to, tosym, to_p);
-		while (*s)
-			fprintf(stderr, "%s, ", *s++);
-		fprintf(stderr, "\n");
+		print_section_list(mismatch->symbol_white_list);
 		free(prl_to);
 		break;
 	}

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

* Re: [PATCH] modpost: fix trailing comma
  2011-03-15 21:13 [PATCH] modpost: fix trailing comma Randy Dunlap
@ 2011-03-17 12:39 ` Michal Marek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2011-03-17 12:39 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, lkml

On Tue, Mar 15, 2011 at 02:13:47PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> Consolidate locations that print a section whitelist into
> calls to print_section_list().
> 
> Fix print_section_list() so that it does not print a trailing
> comma & space:
> 
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 
> 
> becomes:
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  scripts/mod/modpost.c |   23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)

Applied to kbuild-2.6.git#kbuild, thanks.

Michal

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

end of thread, other threads:[~2011-03-17 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 21:13 [PATCH] modpost: fix trailing comma Randy Dunlap
2011-03-17 12:39 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox