diff options
author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-07-11 15:31:37 +0200 |
---|---|---|
committer | Daniel Gomez <da.gomez@samsung.com> | 2025-07-31 13:51:25 +0200 |
commit | 818783c804bc051f7faf0ac226b5597f8259c6f8 (patch) | |
tree | b8fce4e0de19e155beebbfb1db11545f81d26272 /scripts/lib/kdoc/kdoc_output.py | |
parent | 199d9ffb31650f948dd342ade1c1b920e157630f (diff) |
module: make structure definitions always visible
To write code that works with both CONFIG_MODULES=y and CONFIG_MODULES=n
it is convenient to use "if (IS_ENABLED(CONFIG_MODULES))" over raw #ifdef.
The code will still fully typechecked but the unreachable parts are
discarded by the compiler. This prevents accidental breakage when a certain
kconfig combination was not specifically tested by the developer.
This pattern is already supported to some extend by module.h defining
empty stub functions if CONFIG_MODULES=n.
However some users of module.h work on the structured defined by module.h.
Therefore these structure definitions need to be visible, too.
Many structure members are still gated by specific configuration settings.
The assumption for those is that the code using them will be gated behind
the same configuration setting anyways.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Link: https://lore.kernel.org/r/20250711-kunit-ifdef-modules-v2-2-39443decb1f8@linutronix.de
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_output.py')
0 files changed, 0 insertions, 0 deletions