Skip to content

Commit c0397c8

Browse files
cris-masudeep-holla
authored andcommitted
firmware: arm_scmi: Use WARN_ON() to check configured transports
Use a WARN_ON() when SCMI stack is loaded to check the consistency of configured SCMI transports instead of the current compile-time check BUILD_BUG_ON() to avoid breaking bot-builds on random bad configs. Bail-out early and noisy during SCMI stack initialization if no transport was enabled in configuration since SCMI cannot work without at least one enabled transport and such constraint cannot be enforced in Kconfig due to circular dependency issues. Link: https://lore.kernel.org/r/[email protected] Reported-by: kernel test robot <[email protected]> Signed-off-by: Cristian Marussi <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
1 parent d4fda7e commit c0397c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/firmware/arm_scmi/driver.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,9 +2067,11 @@ static int __init scmi_driver_init(void)
20672067
{
20682068
int ret;
20692069

2070-
scmi_bus_init();
2070+
/* Bail out if no SCMI transport was configured */
2071+
if (WARN_ON(!IS_ENABLED(CONFIG_ARM_SCMI_HAVE_TRANSPORT)))
2072+
return -EINVAL;
20712073

2072-
BUILD_BUG_ON(!IS_ENABLED(CONFIG_ARM_SCMI_HAVE_TRANSPORT));
2074+
scmi_bus_init();
20732075

20742076
/* Initialize any compiled-in transport which provided an init/exit */
20752077
ret = scmi_transports_init();

0 commit comments

Comments
 (0)