• Masahiro Yamada's avatar
    modpost: add read_text_file() and get_line() helpers · ac5100f5
    Masahiro Yamada authored
    modpost uses grab_file() to open a file, but it is not suitable for
    a text file because the mmap'ed file is not terminated by null byte.
    Actually, I see some issues for the use of grab_file().
    
    The new helper, read_text_file() loads the whole file content into a
    malloc'ed buffer, and appends a null byte. Then, get_line() reads
    each line.
    
    To handle text files, I intend to replace as follows:
    
      grab_file()    -> read_text_file()
      get_new_line() -> get_line()
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    ac5100f5
modpost.c 69.8 KB