From 35e4b60792cd45d57c3af00f67bb5bf9ae4243e9 Mon Sep 17 00:00:00 2001 From: Julian Braha Date: Sat, 1 Aug 2026 15:52:38 +0100 Subject: kconfig: fix submenu rendering of negative dependencies The Kconfig frontend should render options that depend on a previous option in the submenu of that previous option. But currently, this breaks for negative dependencies. For example, option FOO may be rendered in the submenu of option BAR, despite FOO actually depending on !BAR. Let's fix this ironic rendering by modifying Kconfig to explicitly check negative dependencies. I've only tested locally on x86, but as far as I can tell, this only changes how 2 options are rendered in the menu: 1. NTFS3_FS, no longer in the NTFS_FS submenu, and 2. MTD_BLOCK_RO, no longer in the MTD_BLOCK submenu. Tested-by: Nathan Chancellor Reported-by: Xi Ruoyao Closes: https://lore.kernel.org/all/cbe95c15d2760f6fce8eaf207c969ce8fd3703aa.camel@xry111.site/ Assisted-by: Claude:claude-4.8-opus Signed-off-by: Julian Braha Link: https://patch.msgid.link/20260801145238.2140291-1-julianbraha@gmail.com Reviewed-by: Nicolas Schier Tested-by: Nicolas Schier Signed-off-by: Nicolas Schier --- scripts/kconfig/expr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/kconfig/expr.h') diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index fa3823a97d72..b580f9fa0f29 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -307,6 +307,7 @@ tristate expr_calc_value(struct expr *e); struct expr *expr_eliminate_dups(struct expr *e); struct expr *expr_transform(struct expr *e); bool expr_contains_symbol(struct expr *dep, struct symbol *sym); +bool expr_contains_symbol_negated(struct expr *dep, struct symbol *sym); bool expr_depends_symbol(struct expr *dep, struct symbol *sym); struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); -- cgit