Skip to content

Commit a2ff404

Browse files
committed
kconfig: rename file_write_dep and move it to confdata.c
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>
1 parent 08b220b commit a2ff404

3 files changed

Lines changed: 30 additions & 32 deletions

File tree

‎scripts/kconfig/confdata.c‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,35 @@ int conf_write(const char *name)
818818
return 0;
819819
}
820820

821+
/* write a dependency file as used by kbuild to track dependencies */
822+
static int conf_write_dep(const char *name)
823+
{
824+
struct file *file;
825+
FILE *out;
826+
827+
if (!name)
828+
name = ".kconfig.d";
829+
out = fopen("..config.tmp", "w");
830+
if (!out)
831+
return 1;
832+
fprintf(out, "deps_config := \\\n");
833+
for (file = file_list; file; file = file->next) {
834+
if (file->next)
835+
fprintf(out, "\t%s \\\n", file->name);
836+
else
837+
fprintf(out, "\t%s\n", file->name);
838+
}
839+
fprintf(out, "\n%s: \\\n"
840+
"\t$(deps_config)\n\n", conf_get_autoconfig_name());
841+
842+
env_write_dep(out, conf_get_autoconfig_name());
843+
844+
fprintf(out, "\n$(deps_config): ;\n");
845+
fclose(out);
846+
rename("..config.tmp", name);
847+
return 0;
848+
}
849+
821850
static int conf_split_config(void)
822851
{
823852
const char *name;
@@ -940,7 +969,7 @@ int conf_write_autoconf(void)
940969

941970
sym_clear_all_valid();
942971

943-
file_write_dep("include/config/auto.conf.cmd");
972+
conf_write_dep("include/config/auto.conf.cmd");
944973

945974
if (conf_split_config())
946975
return 1;

‎scripts/kconfig/lkc.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ void menu_set_type(int type);
9797

9898
/* util.c */
9999
struct file *file_lookup(const char *name);
100-
int file_write_dep(const char *name);
101100
void *xmalloc(size_t size);
102101
void *xcalloc(size_t nmemb, size_t size);
103102
void *xrealloc(void *p, size_t size);

‎scripts/kconfig/util.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,6 @@ struct file *file_lookup(const char *name)
2929
return file;
3030
}
3131

32-
/* write a dependency file as used by kbuild to track dependencies */
33-
int file_write_dep(const char *name)
34-
{
35-
struct file *file;
36-
FILE *out;
37-
38-
if (!name)
39-
name = ".kconfig.d";
40-
out = fopen("..config.tmp", "w");
41-
if (!out)
42-
return 1;
43-
fprintf(out, "deps_config := \\\n");
44-
for (file = file_list; file; file = file->next) {
45-
if (file->next)
46-
fprintf(out, "\t%s \\\n", file->name);
47-
else
48-
fprintf(out, "\t%s\n", file->name);
49-
}
50-
fprintf(out, "\n%s: \\\n"
51-
"\t$(deps_config)\n\n", conf_get_autoconfig_name());
52-
53-
env_write_dep(out, conf_get_autoconfig_name());
54-
55-
fprintf(out, "\n$(deps_config): ;\n");
56-
fclose(out);
57-
rename("..config.tmp", name);
58-
return 0;
59-
}
60-
61-
6232
/* Allocate initial growable string */
6333
struct gstr str_new(void)
6434
{

0 commit comments

Comments
 (0)