mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
kconfig: Support conditional deps using "depends on X if Y"
Extend the "depends on" syntax to support conditional dependencies using "depends on X if Y". While functionally equivalent to "depends on X || (Y == n)", "depends on X if Y" is much more readable and makes the kconfig language uniform in supporting the "if <expr>" suffix. This also improves readability for "optional" dependencies, which are the subset of conditional dependencies where X is Y. Previously such optional dependencies had to be expressed as the counterintuitive "depends on X || !X", now this can be represented as "depends on X if X". The change is implemented by converting the "X if Y" syntax into the "X || (Y == n)" syntax during "depends on" token processing. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> [Graham Roff: Rewrote commit message, updated patch, added tests] Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Link: https://patch.msgid.link/20251215-kconfig_conditional_deps-v3-1-59519af0a5df@qti.qualcomm.com [nathan: Minor adjustments to spacing] Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
committed by
Nathan Chancellor
parent
5ce3218d4f
commit
76df6815da
@@ -82,7 +82,7 @@ void menu_warn(const struct menu *menu, const char *fmt, ...);
|
||||
struct menu *menu_add_menu(void);
|
||||
void menu_end_menu(void);
|
||||
void menu_add_entry(struct symbol *sym, enum menu_type type);
|
||||
void menu_add_dep(struct expr *dep);
|
||||
void menu_add_dep(struct expr *dep, struct expr *cond);
|
||||
void menu_add_visibility(struct expr *dep);
|
||||
struct property *menu_add_prompt(enum prop_type type, const char *prompt,
|
||||
struct expr *dep);
|
||||
|
||||
Reference in New Issue
Block a user