kconfig: rename file_write_dep and move it to confdata.c
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 20 Jul 2018 07:46:26 +0000 (16:46 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 25 Jul 2018 14:25:28 +0000 (23:25 +0900)
file_write_dep() is called only from conf_write_autoconf().
Move it from util.c to confdata.c to make it static.
Also, rename it to conf_write_dep() since it should belong to
the group of conf_write* functions.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kconfig/confdata.c
scripts/kconfig/lkc.h
scripts/kconfig/util.c

index 629ad32d4708d852b3d8b6cc0274b8b152c45f2c..c553f1f30c36891b1fb8385c4e497a24094b834e 100644 (file)
@@ -818,6 +818,35 @@ next:
        return 0;
 }
 
+/* write a dependency file as used by kbuild to track dependencies */
+static int conf_write_dep(const char *name)
+{
+       struct file *file;
+       FILE *out;
+
+       if (!name)
+               name = ".kconfig.d";
+       out = fopen("..config.tmp", "w");
+       if (!out)
+               return 1;
+       fprintf(out, "deps_config := \\\n");
+       for (file = file_list; file; file = file->next) {
+               if (file->next)
+                       fprintf(out, "\t%s \\\n", file->name);
+               else
+                       fprintf(out, "\t%s\n", file->name);
+       }
+       fprintf(out, "\n%s: \\\n"
+                    "\t$(deps_config)\n\n", conf_get_autoconfig_name());
+
+       env_write_dep(out, conf_get_autoconfig_name());
+
+       fprintf(out, "\n$(deps_config): ;\n");
+       fclose(out);
+       rename("..config.tmp", name);
+       return 0;
+}
+
 static int conf_split_config(void)
 {
        const char *name;
@@ -940,7 +969,7 @@ int conf_write_autoconf(void)
 
        sym_clear_all_valid();
 
-       file_write_dep("include/config/auto.conf.cmd");
+       conf_write_dep("include/config/auto.conf.cmd");
 
        if (conf_split_config())
                return 1;
index ed3ff88e60ba11dad4c8da68865526999b35626b..6b7bbc6238e3f11ef3b02f0bfc7be978eba599d0 100644 (file)
@@ -97,7 +97,6 @@ void menu_set_type(int type);
 
 /* util.c */
 struct file *file_lookup(const char *name);
-int file_write_dep(const char *name);
 void *xmalloc(size_t size);
 void *xcalloc(size_t nmemb, size_t size);
 void *xrealloc(void *p, size_t size);
index a365594770d9daaaaf3220c80eb1522113930072..d999683bb2a778ae05841531abad3fc3e323d4a0 100644 (file)
@@ -29,36 +29,6 @@ struct file *file_lookup(const char *name)
        return file;
 }
 
-/* write a dependency file as used by kbuild to track dependencies */
-int file_write_dep(const char *name)
-{
-       struct file *file;
-       FILE *out;
-
-       if (!name)
-               name = ".kconfig.d";
-       out = fopen("..config.tmp", "w");
-       if (!out)
-               return 1;
-       fprintf(out, "deps_config := \\\n");
-       for (file = file_list; file; file = file->next) {
-               if (file->next)
-                       fprintf(out, "\t%s \\\n", file->name);
-               else
-                       fprintf(out, "\t%s\n", file->name);
-       }
-       fprintf(out, "\n%s: \\\n"
-                    "\t$(deps_config)\n\n", conf_get_autoconfig_name());
-
-       env_write_dep(out, conf_get_autoconfig_name());
-
-       fprintf(out, "\n$(deps_config): ;\n");
-       fclose(out);
-       rename("..config.tmp", name);
-       return 0;
-}
-
-
 /* Allocate initial growable string */
 struct gstr str_new(void)
 {