Commit 8fa69088 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Wentao Guan
Browse files

kconfig: fix file name in warnings when loading KCONFIG_DEFCONFIG_LIST

stable inclusion
from stable-v6.6.76
commit 13dc6f1692e002a732b00d13f6b48f354446c4cd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBW08Q

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=13dc6f1692e002a732b00d13f6b48f354446c4cd



--------------------------------

[ Upstream commit a314f52a0210730d0d556de76bb7388e76d4597d ]

Most 'make *config' commands use .config as the base configuration file.

When .config does not exist, Kconfig tries to load a file listed in
KCONFIG_DEFCONFIG_LIST instead.

However, since commit b75b0a81 ("kconfig: change defconfig_list
option to environment variable"), warning messages have displayed an
incorrect file name in such cases.

Below is a demonstration using Debian Trixie. While loading
/boot/config-6.12.9-amd64, the warning messages incorrectly show .config
as the file name.

With this commit, the correct file name is displayed in warnings.

[Before]

  $ rm -f .config
  $ make config
  #
  # using defaults found in /boot/config-6.12.9-amd64
  #
  .config:6804:warning: symbol value 'm' invalid for FB_BACKLIGHT
  .config:9895:warning: symbol value 'm' invalid for ANDROID_BINDER_IPC

[After]

  $ rm -f .config
  $ make config
  #
  # using defaults found in /boot/config-6.12.9-amd64
  #
  /boot/config-6.12.9-amd64:6804:warning: symbol value 'm' invalid for FB_BACKLIGHT
  /boot/config-6.12.9-amd64:9895:warning: symbol value 'm' invalid for ANDROID_BINDER_IPC

Fixes: b75b0a81 ("kconfig: change defconfig_list option to environment variable")
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 13dc6f1692e002a732b00d13f6b48f354446c4cd)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent a36e1fb7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -386,10 +386,12 @@ int conf_read_simple(const char *name, int def)

			*p = '\0';

			in = zconf_fopen(env);
			name = env;

			in = zconf_fopen(name);
			if (in) {
				conf_message("using defaults found in %s",
					     env);
					     name);
				goto load;
			}