History

kallsyms: add static qualifiers where missing

Fix the following sparse warnings: scripts/kallsyms.c:65:5: warning: symbol 'token_profit' was not declared. Should it be static? scripts/kallsyms.c:68:15: warning: symbol 'best_table' was not declared. Should it be static? scripts/kallsyms.c:69:15: warning: symbol 'best_table_len' was not declared. Should it be static? Also, remove 'inline' from is_arm_mapping_symbol(). The compiler will inline it anyway when it is appropriate to do so.

Masahiro Yamada committed 7 years ago

Commit f43e9da1 parent 3a51ff31 file · +4 −4Browse files

Unified · Split

scripts/kallsyms.c+4−4
@@ -62,11 +62,11 @@ static int all_symbols = 0; · 61 unmodified lines
62static int absolute_percpu = 0;62static int absolute_percpu = 0;
63static int base_relative = 0;63static int base_relative = 0;
64 64
65int token_profit[0x10000];65static int token_profit[0x10000];
66 66
67/* the table that holds the result of the compression */67/* the table that holds the result of the compression */
68unsigned char best_table[256][2];68static unsigned char best_table[256][2];
69unsigned char best_table_len[256];69static unsigned char best_table_len[256];
70 70
71 71
72static void usage(void)72static void usage(void)
@@ -80,7 +80,7 @@ static void usage(void) · 7 unmodified lines
80 * This ignores the intensely annoying "mapping symbols" found80 * This ignores the intensely annoying "mapping symbols" found
81 * in ARM ELF files: $a, $t and $d.81 * in ARM ELF files: $a, $t and $d.
82 */82 */
83static inline int is_arm_mapping_symbol(const char *str)83static int is_arm_mapping_symbol(const char *str)
84{84{
85 return str[0] == '$' && strchr("axtd", str[1])85 return str[0] == '$' && strchr("axtd", str[1])
86 && (str[2] == '\0' || str[2] == '.');86 && (str[2] == '\0' || str[2] == '.');