]> git.baikalelectronics.ru Git - kernel.git/commit
modpost: use read_text_file() and get_line() for reading text files
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 1 Jun 2020 05:57:20 +0000 (14:57 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 6 Jun 2020 14:38:13 +0000 (23:38 +0900)
commit26c9ca381acbf3ab1339934f900357f7a3d137da
tree5c5026083bab0d89b97a1e9f33a363abd3bd162b
parentdedf1a79be0dffb625192b0f7d75e2cfb8aab4d0
modpost: use read_text_file() and get_line() for reading text files

grab_file() mmaps a file, but it is not so efficient here because
get_next_line() copies every line to the temporary buffer anyway.

read_text_file() and get_line() are simpler. get_line() exploits the
library function strchr().

Going forward, the missing *.symvers or *.cmd is a fatal error.
This should not happen because scripts/Makefile.modpost guards the
-i option files with $(wildcard $(input-symdump)).

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c
scripts/mod/sumversion.c