diff mbox series

[06/10] kconfig: add conf_get_autoheader_name()

Message ID 20211001053253.1223316-6-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [01/10] kconfig: remove 'const' from the return type of sym_escape_string_value() | expand

Commit Message

Masahiro Yamada Oct. 1, 2021, 5:32 a.m. UTC
For consistency with conf_get_autoconfig_name()

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/confdata.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 78af1dd68894..2c518aaa5255 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -223,6 +223,13 @@  static const char *conf_get_autoconfig_name(void)
 	return name ? name : "include/config/auto.conf";
 }
 
+static const char *conf_get_autoheader_name(void)
+{
+	char *name = getenv("KCONFIG_AUTOHEADER");
+
+	return name ? name : "include/generated/autoconf.h";
+}
+
 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 {
 	char *p2;
@@ -1092,9 +1099,7 @@  int conf_write_autoconf(int overwrite)
 	fclose(out);
 	fclose(out_h);
 
-	name = getenv("KCONFIG_AUTOHEADER");
-	if (!name)
-		name = "include/generated/autoconf.h";
+	name = conf_get_autoheader_name();
 	if (make_parent_dir(name))
 		return 1;
 	if (rename(".tmpconfig.h", name))