[PATCH v2 3/7] fixdep: factor out common code for reading files

2018-01-11 Thread Masahiro Yamada
Now, do_config_files() and print_deps() are almost the same. Only the difference is the parser function called (parse_config_file vs parse_dep_file). We can reduce the code duplication by factoring out the common code into read_file() - this function allocates a buffer and loads a file to it.

[PATCH v2 3/7] fixdep: factor out common code for reading files

2018-01-11 Thread Masahiro Yamada
Now, do_config_files() and print_deps() are almost the same. Only the difference is the parser function called (parse_config_file vs parse_dep_file). We can reduce the code duplication by factoring out the common code into read_file() - this function allocates a buffer and loads a file to it.