Skip to content

Commit 78dfd0f

Browse files
lyakhkv2019i
authored andcommitted
tree-wide: add missing preprocessor comments
Use the add-endif-comments.py script to add missing comments to ipc, library_manager and schedule directories under src/. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent c81ac11 commit 78dfd0f

16 files changed

Lines changed: 66 additions & 66 deletions

‎src/ipc/ipc-common.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void z_vrfy_ipc_msg_send(struct ipc_msg *msg, void *data, bool high_priority)
336336
z_impl_ipc_msg_send(msg, data, high_priority);
337337
}
338338
#include <zephyr/syscalls/ipc_msg_send_mrsh.c>
339-
#endif
339+
#endif /* CONFIG_USERSPACE */
340340

341341
void z_impl_ipc_msg_list_remove(struct ipc_msg *msg)
342342
{
@@ -375,7 +375,7 @@ void z_vrfy_ipc_msg_list_remove(struct ipc_msg *msg)
375375
z_impl_ipc_msg_list_remove(msg);
376376
}
377377
#include <zephyr/syscalls/ipc_msg_list_remove_mrsh.c>
378-
#endif
378+
#endif /* CONFIG_USERSPACE */
379379

380380
#ifdef __ZEPHYR__
381381
static void ipc_work_handler(struct k_work *work)
@@ -683,7 +683,7 @@ __cold static void ipc_user_init(void)
683683
LOG_WRN("cold rodata partition %#zx @ %#lx add failed: %d",
684684
cold_part.size, cold_part.start, ret);
685685
}
686-
#endif
686+
#endif /* CONFIG_COLD_STORE_EXECUTE_DRAM */
687687

688688
k_sem_init(ipc_user->sem, 0, 1);
689689

@@ -730,7 +730,7 @@ __cold static void ipc_user_init(void)
730730
/* Wait for user thread startup — consumes the initial k_sem_give from thread */
731731
k_sem_take(ipc_user->sem, K_FOREVER);
732732
}
733-
#else
733+
#else /* CONFIG_SOF_USERSPACE_LL */
734734
static void ipc_user_init(void)
735735
{
736736
}
@@ -768,7 +768,7 @@ __cold int ipc_init(struct sof *sof)
768768
return -ENOMEM;
769769
}
770770
sof->ipc = ipc;
771-
#endif
771+
#endif /* CONFIG_SOF_USERSPACE_LL */
772772

773773
ipc->comp_data = sof_heap_alloc(heap, SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT,
774774
SOF_IPC_MSG_MAX_SIZE, 0);
@@ -818,7 +818,7 @@ __cold int ipc_init(struct sof *sof)
818818
k_thread_resume(thread);
819819

820820
k_work_init_delayable(&ipc->z_delayed_work, ipc_work_handler);
821-
#endif
821+
#endif /* __ZEPHYR__ */
822822

823823
ipc_user_init();
824824

‎src/ipc/ipc3/dai.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
225225
}
226226
}
227227
}
228-
#endif
228+
#endif /* defined(CONFIG_AMD) && !defined(CONFIG_SOC_ACP_6_0) */
229229
break;
230230
case SOF_DAI_AMD_SDW:
231231
#if defined(CONFIG_AMD) && !defined(CONFIG_SOC_ACP_6_0)
@@ -265,7 +265,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
265265
pin_data->instance = DAI_INDEX_INVALID;
266266
dev_data->dai_index_ptr = pin_data;
267267
}
268-
#endif
268+
#endif /* defined(CONFIG_AMD) && !defined(CONFIG_SOC_ACP_6_0) */
269269
break;
270270
case SOF_DAI_MEDIATEK_AFE:
271271
break;
@@ -390,7 +390,7 @@ void dai_dma_release(struct dai_data *dd, struct comp_dev *dev)
390390
dd->chan->dev_data = NULL;
391391
dd->chan = NULL;
392392
}
393-
#endif
393+
#endif /* CONFIG_ZEPHYR_NATIVE_DRIVERS */
394394
}
395395

396396
int dai_config(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *common_config,

‎src/ipc/ipc3/handler.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static bool is_hostless_upstream(struct comp_dev *current)
191191

192192
return true;
193193
}
194-
#endif
194+
#endif /* CONFIG_HOST_PTABLE */
195195

196196
/* allocate a new stream */
197197
static int ipc_stream_pcm_params(uint32_t stream)
@@ -305,7 +305,7 @@ static int ipc_stream_pcm_params(uint32_t stream)
305305
}
306306

307307
pipe_params:
308-
#endif
308+
#endif /* CONFIG_HOST_PTABLE */
309309

310310
/* configure pipeline audio params */
311311
err = pipeline_params(pcm_dev->cd->pipeline, pcm_dev->cd,
@@ -694,7 +694,7 @@ static int ipc_pm_context_save(uint32_t header)
694694

695695
/* write the context to the host driver */
696696
//mailbox_hostbox_write(0, pm_ctx, sizeof(*pm_ctx));
697-
#endif
697+
#endif /* !defined(CONFIG_LIBRARY) && !defined(CONFIG_ZEPHYR_POSIX) */
698698
ipc_get()->pm_prepare_D3 = 1;
699699

700700
return 0;
@@ -866,7 +866,7 @@ static int ipc_dma_trace_config(uint32_t header)
866866

867867
/* host buffer size for DMA trace */
868868
dmat->host_size = params.buffer.size;
869-
#endif
869+
#endif /* CONFIG_HOST_PTABLE */
870870

871871
err = dma_trace_enable(dmat);
872872
if (err < 0) {
@@ -956,7 +956,7 @@ static int ipc_glb_trace_message(uint32_t header)
956956
return -EINVAL;
957957
}
958958
}
959-
#else
959+
#else /* CONFIG_TRACE */
960960
static int ipc_glb_trace_message(uint32_t header)
961961
{
962962
/* Return success, as the protocol provides no way to inform
@@ -965,7 +965,7 @@ static int ipc_glb_trace_message(uint32_t header)
965965
*/
966966
return 0;
967967
}
968-
#endif
968+
#endif /* CONFIG_TRACE */
969969

970970
static int ipc_glb_gdb_debug(uint32_t header)
971971
{
@@ -1174,14 +1174,14 @@ static int ipc_glb_probe(uint32_t header)
11741174
return -EINVAL;
11751175
}
11761176
}
1177-
#else
1177+
#else /* CONFIG_PROBE */
11781178
static inline int ipc_glb_probe(uint32_t header)
11791179
{
11801180
ipc_cmd_err(&ipc_tr, "Probes not enabled by Kconfig.");
11811181

11821182
return -EINVAL;
11831183
}
1184-
#endif
1184+
#endif /* CONFIG_PROBE */
11851185

11861186
/*
11871187
* Topology IPC Operations.
@@ -1490,7 +1490,7 @@ struct ipc_cmd_hdr *ipc_compact_read_msg(void)
14901490

14911491
return NULL;
14921492
}
1493-
#endif
1493+
#endif /* CONFIG_CAVS */
14941494

14951495
/* prepare the message using ABI major layout */
14961496
struct ipc_cmd_hdr *ipc_prepare_to_send(const struct ipc_msg *msg)
@@ -1539,7 +1539,7 @@ static int ipc_fw_ready(void)
15391539
* contiguously in the hostbox)
15401540
*/
15411541
return platform_boot_complete(0);
1542-
#else
1542+
#else /* CONFIG_IMX93_A55 */
15431543
/* any other platform should not receive SOF_IPC_FW_READY from host */
15441544
return -EINVAL;
15451545
#endif /* CONFIG_IMX93_A55 */

‎src/ipc/ipc3/helper.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static int comp_specific_builder(struct sof_ipc_comp *comp,
232232
config->file.module_header.data = (uint8_t *)proc->data -
233233
sizeof(struct ipc_config_process);
234234
break;
235-
#endif
235+
#endif /* CONFIG_LIBRARY */
236236
case SOF_COMP_HOST:
237237
case SOF_COMP_SG_HOST:
238238
if (IPC_TAIL_IS_SIZE_INVALID(*host))

‎src/ipc/ipc3/host-page-table.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int ipc_get_page_descriptors(struct sof_dma *dmac, uint8_t *page_table,
164164

165165
return ret;
166166
}
167-
#else
167+
#else /* CONFIG_ZEPHYR_NATIVE_DRIVERS */
168168
static int ipc_get_page_descriptors(struct dma *dmac, uint8_t *page_table,
169169
struct sof_ipc_host_buffer *ring)
170170
{

‎src/ipc/ipc4/dai.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void dai_set_link_hda_config(uint16_t *link_config,
7474
return;
7575
}
7676
*link_config = link_cfg.full;
77-
#endif
77+
#endif /* ACE_VERSION > ACE_VERSION_1_5 */
7878
}
7979

8080
int dai_config_dma_channel(struct dai_data *dd, struct comp_dev *dev, const void *spec_config)

‎src/ipc/ipc4/handler-kernel.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static inline void ipc4_send_reply(struct ipc4_message_reply *reply)
9797
ret = memcpy_s(ipc->comp_data, sizeof(*reply), reply, sizeof(*reply));
9898
assert(!ret);
9999
}
100-
#else
100+
#else /* CONFIG_LIBRARY */
101101
static inline struct ipc4_message_request *ipc4_get_message_request(void)
102102
{
103103
/* ignoring _hdr as it does not contain valid data in IPC4/IDC case */
@@ -112,7 +112,7 @@ static inline void ipc4_send_reply(struct ipc4_message_reply *reply)
112112
ipc_msg_send(&msg_reply, data, true);
113113
}
114114

115-
#endif
115+
#endif /* CONFIG_LIBRARY */
116116

117117
__cold static bool is_any_ppl_active(void)
118118
{
@@ -186,7 +186,7 @@ void z_vrfy_ipc_compound_post_start(uint32_t msg_id, int ret, bool delayed)
186186
z_impl_ipc_compound_post_start(msg_id, ret, delayed);
187187
}
188188
#include <zephyr/syscalls/ipc_compound_post_start_mrsh.c>
189-
#endif
189+
#endif /* CONFIG_USERSPACE */
190190

191191
void ipc_compound_msg_done(uint32_t msg_id, int error)
192192
{
@@ -247,7 +247,7 @@ int z_vrfy_ipc_wait_for_compound_msg(void)
247247
}
248248
#include <zephyr/syscalls/ipc_wait_for_compound_msg_mrsh.c>
249249
#endif
250-
#endif
250+
#endif /* CONFIG_LIBRARY */
251251

252252
#if CONFIG_LIBRARY_MANAGER
253253
__cold static int ipc4_load_library(struct ipc4_message_request *ipc4)
@@ -266,7 +266,7 @@ __cold static int ipc4_load_library(struct ipc4_message_request *ipc4)
266266

267267
return IPC4_SUCCESS;
268268
}
269-
#endif
269+
#endif /* CONFIG_LIBRARY_MANAGER */
270270

271271
static int ipc4_process_glb_message(struct ipc4_message_request *ipc4)
272272
{
@@ -564,7 +564,7 @@ void ipc_send_buffer_status_notify(void)
564564

565565
ipc_msg_send(&msg_notify, NULL, true);
566566
}
567-
#endif
567+
#endif /* CONFIG_LOG_BACKEND_ADSP_MTRACE */
568568

569569
void z_impl_ipc_msg_reply(struct sof_ipc_reply *reply)
570570
{

‎src/ipc/ipc4/handler-user.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static inline const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data(
8686

8787
return ppl_data;
8888
}
89-
#endif
89+
#endif /* CONFIG_LIBRARY */
9090
/*
9191
* Global IPC Operations.
9292
*/
@@ -114,7 +114,7 @@ static unsigned int ipc4_user_target_core_module(struct ipc4_message_request *ip
114114

115115
return cpu_get_id();
116116
}
117-
#else
117+
#else /* CONFIG_SOF_USERSPACE_LL */
118118
__cold static int ipc4_new_pipeline(struct ipc4_message_request *ipc4)
119119
{
120120
struct ipc *ipc = ipc_get();
@@ -136,7 +136,7 @@ __cold static int ipc4_delete_pipeline(struct ipc4_message_request *ipc4)
136136

137137
return ipc_pipeline_free(ipc, pipe->primary.r.instance_id);
138138
}
139-
#endif
139+
#endif /* CONFIG_SOF_USERSPACE_LL */
140140

141141
static int ipc4_pcm_params(struct ipc_comp_dev *pcm_dev)
142142
{
@@ -653,9 +653,9 @@ __cold static int ipc4_process_chain_dma(struct ipc4_message_request *ipc4)
653653
return IPC4_INVALID_CHAIN_STATE_TRANSITION;
654654

655655
return IPC4_SUCCESS;
656-
#else
656+
#else /* CONFIG_COMP_CHAIN_DMA */
657657
return IPC4_UNAVAILABLE;
658-
#endif
658+
#endif /* CONFIG_COMP_CHAIN_DMA */
659659
}
660660

661661
__cold static int ipc4_process_ipcgtw_cmd(struct ipc4_message_request *ipc4)
@@ -678,10 +678,10 @@ __cold static int ipc4_process_ipcgtw_cmd(struct ipc4_message_request *ipc4)
678678
}
679679

680680
return err < 0 ? IPC4_FAILURE : IPC4_SUCCESS;
681-
#else
681+
#else /* CONFIG_IPC4_GATEWAY */
682682
ipc_cmd_err(&ipc_tr, "CONFIG_IPC4_GATEWAY is disabled");
683683
return IPC4_UNAVAILABLE;
684-
#endif
684+
#endif /* CONFIG_IPC4_GATEWAY */
685685
}
686686

687687
static int ipc_glb_gdb_debug(struct ipc4_message_request *ipc4)
@@ -774,9 +774,9 @@ int ipc4_user_process_glb_message(struct ipc4_message_request *ipc4,
774774
}
775775
ret = ipc_user_forward_cmd(ipc4->primary.dat, ipc4->extension.dat, ppl->core);
776776
}
777-
#else
777+
#else /* CONFIG_SOF_USERSPACE_LL */
778778
ret = ipc4_set_pipeline_state(ipc4);
779-
#endif
779+
#endif /* CONFIG_SOF_USERSPACE_LL */
780780
break;
781781

782782
case SOF_IPC4_GLB_GET_PIPELINE_STATE:
@@ -1599,7 +1599,7 @@ __cold int ipc4_user_process_module_message(struct ipc4_message_request *ipc4,
15991599
ipc_get()->ipc_user_pdata->init_drv = drv;
16001600
ret = ipc_user_forward_cmd(ipc4->primary.dat, ipc4->extension.dat,
16011601
mi->extension.r.core_id);
1602-
#endif
1602+
#endif /* CONFIG_SOF_USERSPACE_LL */
16031603
} else {
16041604
/*
16051605
* DP module creation starts running in kernel mode and
@@ -1659,9 +1659,9 @@ __cold int ipc4_user_process_module_message(struct ipc4_message_request *ipc4,
16591659
ret = ipc4_get_large_config_module_instance(ipc4);
16601660
}
16611661
}
1662-
#else
1662+
#else /* CONFIG_SOF_USERSPACE_LL */
16631663
ret = ipc4_get_large_config_module_instance(ipc4);
1664-
#endif
1664+
#endif /* CONFIG_SOF_USERSPACE_LL */
16651665
break;
16661666
case SOF_IPC4_MOD_LARGE_CONFIG_SET:
16671667
#ifdef CONFIG_SOF_USERSPACE_LL

0 commit comments

Comments
 (0)