scripts/kallsyms: add sym_name() to mitigate cast ugliness
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 23 Nov 2019 16:04:35 +0000 (01:04 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 25 Nov 2019 12:03:33 +0000 (21:03 +0900)
commit29e55ad3d5f50eca6f8762749da85d6fa1250061
tree87bea5c6a8ef1c9a652a51dcf3a05086e59af031
parentc5e5002f3603e01f50d8d61878a4ca8ffca7bd15
scripts/kallsyms: add sym_name() to mitigate cast ugliness

sym_entry::sym is (unsigned char *) instead of (char *) because
kallsyms exploits the MSB for compression, and the characters are
used as the index of token_profit array.

However, it requires casting (unsigned char *) to (char *) in some
places since standard library functions such as strcmp(), strlen()
expect (char *).

Introduce a new helper, sym_name(), which advances the given pointer
by 1 and casts it to (char *).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kallsyms.c