diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2011-03-15 17:13:47 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-03-17 08:02:31 -0400 |
commit | 00759c0ea0d3b4c918539ddd7cbbfbbb39a38fc7 (patch) | |
tree | 77fe2c1e373504e830c0f6d2312436f74963d0c5 /scripts | |
parent | e1b702cf224df446b4ce0416dfb02858e7cc068b (diff) |
modpost: fix trailing comma
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>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mod/modpost.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index e8fba959fffb..cd104afcc5f2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -1248,6 +1248,19 @@ static int is_function(Elf_Sym *sym) | |||
1248 | return -1; | 1248 | return -1; |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | static void print_section_list(const char * const list[20]) | ||
1252 | { | ||
1253 | const char *const *s = list; | ||
1254 | |||
1255 | while (*s) { | ||
1256 | fprintf(stderr, "%s", *s); | ||
1257 | s++; | ||
1258 | if (*s) | ||
1259 | fprintf(stderr, ", "); | ||
1260 | } | ||
1261 | fprintf(stderr, "\n"); | ||
1262 | } | ||
1263 | |||
1251 | /* | 1264 | /* |
1252 | * Print a warning about a section mismatch. | 1265 | * Print a warning about a section mismatch. |
1253 | * Try to find symbols near it so user can find it. | 1266 | * Try to find symbols near it so user can find it. |
@@ -1304,7 +1317,6 @@ static void report_sec_mismatch(const char *modname, | |||
1304 | break; | 1317 | break; |
1305 | case DATA_TO_ANY_INIT: { | 1318 | case DATA_TO_ANY_INIT: { |
1306 | prl_to = sec2annotation(tosec); | 1319 | prl_to = sec2annotation(tosec); |
1307 | const char *const *s = mismatch->symbol_white_list; | ||
1308 | fprintf(stderr, | 1320 | fprintf(stderr, |
1309 | "The variable %s references\n" | 1321 | "The variable %s references\n" |
1310 | "the %s %s%s%s\n" | 1322 | "the %s %s%s%s\n" |
@@ -1312,9 +1324,7 @@ static void report_sec_mismatch(const char *modname, | |||
1312 | "variable with __init* or __refdata (see linux/init.h) " | 1324 | "variable with __init* or __refdata (see linux/init.h) " |
1313 | "or name the variable:\n", | 1325 | "or name the variable:\n", |
1314 | fromsym, to, prl_to, tosym, to_p); | 1326 | fromsym, to, prl_to, tosym, to_p); |
1315 | while (*s) | 1327 | print_section_list(mismatch->symbol_white_list); |
1316 | fprintf(stderr, "%s, ", *s++); | ||
1317 | fprintf(stderr, "\n"); | ||
1318 | free(prl_to); | 1328 | free(prl_to); |
1319 | break; | 1329 | break; |
1320 | } | 1330 | } |
@@ -1329,7 +1339,6 @@ static void report_sec_mismatch(const char *modname, | |||
1329 | break; | 1339 | break; |
1330 | case DATA_TO_ANY_EXIT: { | 1340 | case DATA_TO_ANY_EXIT: { |
1331 | prl_to = sec2annotation(tosec); | 1341 | prl_to = sec2annotation(tosec); |
1332 | const char *const *s = mismatch->symbol_white_list; | ||
1333 | fprintf(stderr, | 1342 | fprintf(stderr, |
1334 | "The variable %s references\n" | 1343 | "The variable %s references\n" |
1335 | "the %s %s%s%s\n" | 1344 | "the %s %s%s%s\n" |
@@ -1337,9 +1346,7 @@ static void report_sec_mismatch(const char *modname, | |||
1337 | "variable with __exit* (see linux/init.h) or " | 1346 | "variable with __exit* (see linux/init.h) or " |
1338 | "name the variable:\n", | 1347 | "name the variable:\n", |
1339 | fromsym, to, prl_to, tosym, to_p); | 1348 | fromsym, to, prl_to, tosym, to_p); |
1340 | while (*s) | 1349 | print_section_list(mismatch->symbol_white_list); |
1341 | fprintf(stderr, "%s, ", *s++); | ||
1342 | fprintf(stderr, "\n"); | ||
1343 | free(prl_to); | 1350 | free(prl_to); |
1344 | break; | 1351 | break; |
1345 | } | 1352 | } |