Skip to content

Commit d721f76

Browse files
committed
zephyr: lib: add build assert on NUM_CLOCKS
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 <kai.vehmanen@linux.intel.com>
1 parent 2b6341e commit d721f76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zephyr/lib/clk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ void platform_clock_init(struct sof *sof)
2828

2929
sof->clocks = platform_clocks_info;
3030

31+
BUILD_ASSERT(NUM_CLOCKS >= CONFIG_CORE_COUNT, "Invalid NUM_CLOCKS");
32+
3133
for (i = 0; i < CONFIG_CORE_COUNT; i++) {
3234
sof->clocks[i] = (struct clock_info) {
3335
.freqs_num = NUM_CPU_FREQ,

0 commit comments

Comments
 (0)