Skip to content

Commit 06ae348

Browse files
committed
Fix _str_default() to return implicit zero for INT/HEX
sym_get_string_default() in scripts/kconfig/symbol.c (Linux) returns "0" for INT and "0x0" for HEX when no explicit default exists. Kconfiglib's _str_default() was returning "" instead, causing write_min_config() to include hex symbols whose value matches the implicit zero default (e.g. DEBUG_UART_PHYS=0x0 in arm rpc_defconfig).
1 parent 5945655 commit 06ae348

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kconfiglib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5212,6 +5212,13 @@ def _str_default(self):
52125212
if expr_value(cond):
52135213
return default.str_value
52145214

5215+
# sym_get_string_default() in scripts/kconfig/symbol.c (Linux)
5216+
# returns "0" for INT and "0x0" for HEX when no default exists.
5217+
if self.orig_type is INT:
5218+
return "0"
5219+
if self.orig_type is HEX:
5220+
return "0x0"
5221+
52155222
return ""
52165223

52175224
def _warn_select_unsatisfied_deps(self):

0 commit comments

Comments
 (0)