Skip to content

Commit

Permalink
zephyr: lib: add build assert on NUM_CLOCKS
Browse files Browse the repository at this point in the history
Add a build assert to ensure platform NUM_CLOCKS is set to at least
CONFIG_CORE_COUNT. This is assumed to hold in the implementation of
platform_clock_init().

Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i committed Nov 27, 2024
1 parent 2b6341e commit d721f76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zephyr/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ void platform_clock_init(struct sof *sof)

sof->clocks = platform_clocks_info;

BUILD_ASSERT(NUM_CLOCKS >= CONFIG_CORE_COUNT, "Invalid NUM_CLOCKS");

for (i = 0; i < CONFIG_CORE_COUNT; i++) {
sof->clocks[i] = (struct clock_info) {
.freqs_num = NUM_CPU_FREQ,
Expand Down

0 comments on commit d721f76

Please sign in to comment.