Skip to content

Commit d31370b

Browse files
wjablon1lgirdwood
authored andcommitted
ipc4: base_fw: Make Astate handler a function
Moving Astate handler to a function because STATIC_ASSERT cannot be used as the first instruction of switch/case block Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
1 parent a028604 commit d31370b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/audio/base_fw.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,16 @@ __cold static int basefw_get_large_config(struct comp_dev *dev, uint32_t param_i
630630
data_offset, data);
631631
};
632632

633+
__cold static int basefw_astate_table(void)
634+
{
635+
assert_can_be_cold();
636+
637+
/* Trivial handler possible due to an empty Astate Table requested in get_large_config */
638+
STATIC_ASSERT(IPC4_MAX_CLK_STATES == 0, IPC4_NON_ZERO_ASTATE_UNSUPPORTED);
639+
640+
return IPC4_SUCCESS;
641+
}
642+
633643
/**
634644
* Handles the DMA Control IPC message to initialize or modify DMA gateway configuration.
635645
*
@@ -682,9 +692,7 @@ __cold static int basefw_set_large_config(struct comp_dev *dev, uint32_t param_i
682692

683693
switch (param_id) {
684694
case IPC4_ASTATE_TABLE:
685-
/* Trivial handler due to an empty Astate Table requested in get_large_config */
686-
STATIC_ASSERT(IPC4_MAX_CLK_STATES == 0, IPC4_NON_ZERO_ASTATE_UNSUPPORTED);
687-
return IPC4_SUCCESS;
695+
return basefw_astate_table();
688696
case IPC4_DMA_CONTROL:
689697
return basefw_dma_control(first_block, last_block, data_offset, data);
690698
case IPC4_PERF_MEASUREMENTS_STATE:

0 commit comments

Comments
 (0)