[14/16] scripts/kallsyms: check no valid symbol earlier

Message ID 20191123132727.30151-15-yamada.masahiro@socionext.com
State New
Headers show
Series
  • scripts/kallsyms: various cleanups and optimizations
Related show

Commit Message

Masahiro Yamada Nov. 23, 2019, 1:27 p.m.
insert_real_symbols_in_table() does not touch table_cnt, so the
no valid symbol check can be moved before it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 scripts/kallsyms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

Patch

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 144f43363c4d..919cb45ce9db 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -608,14 +608,14 @@  static void optimize_token_table(void)
 {
 	build_initial_tok_table();
 
-	insert_real_symbols_in_table();
-
 	/* When valid symbol is not registered, exit to error */
 	if (!table_cnt) {
 		fprintf(stderr, "No valid symbol.\n");
 		exit(1);
 	}
 
+	insert_real_symbols_in_table();
+
 	optimize_result();
 }