History

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.

Cristian Marussi committed 5 years ago

Commit c0397c81 parent d4fda7e1 file · +4 −2Browse files

Unified · Split

drivers/firmware/arm_scmi/driver.c+4−2
@@ -2067,9 +2067,11 @@ static int __init scmi_driver_init(void) · 2066 unmodified lines
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();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t