Skip to content

Commit 3d78863

Browse files
lyakhlgirdwood
authored andcommitted
src: mark code as "cold"
Mark further initialisation, configuration and freeing paths as "cold." Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent 4002014 commit 3d78863

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

src/audio/src/src.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
LOG_MODULE_DECLARE(src, CONFIG_SOF_LOG_LEVEL);
3535

36-
static int src_prepare(struct processing_module *mod,
37-
struct sof_source **sources, int num_of_sources,
38-
struct sof_sink **sinks, int num_of_sinks)
36+
__cold static int src_prepare(struct processing_module *mod,
37+
struct sof_source **sources, int num_of_sources,
38+
struct sof_sink **sinks, int num_of_sinks)
3939
{
4040
struct comp_data *cd = module_get_private_data(mod);
4141
struct src_param *a = &cd->param;

src/audio/src/src_common.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL);
4545

4646
/* Calculates buffers to allocate for a SRC mode */
47-
static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, int nch)
47+
__cold static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, int nch)
4848
{
4949
const struct src_stage *stage1;
5050
const struct src_stage *stage2;
@@ -183,8 +183,8 @@ static int init_stages(const struct src_stage *stage1, const struct src_stage *s
183183
return 0;
184184
}
185185

186-
static int src_polyphase_init(struct polyphase_src *src, struct src_param *p,
187-
int32_t *delay_lines_start)
186+
__cold static int src_polyphase_init(struct polyphase_src *src, struct src_param *p,
187+
int32_t *delay_lines_start)
188188
{
189189
const struct src_stage *stage1;
190190
const struct src_stage *stage2;
@@ -392,7 +392,7 @@ void src_set_alignment(struct sof_source *source, struct sof_sink *sink)
392392
sink_set_alignment_constants(sink, byte_align, frame_align_req);
393393
}
394394

395-
static int src_verify_params(struct processing_module *mod)
395+
__cold static int src_verify_params(struct processing_module *mod)
396396
{
397397
struct sof_ipc_stream_params *params = mod->stream_params;
398398
struct comp_data *cd = module_get_private_data(mod);
@@ -473,9 +473,9 @@ static bool src_get_copy_limits(struct comp_data *cd,
473473
return true;
474474
}
475475

476-
int src_params_general(struct processing_module *mod,
477-
struct sof_source *source,
478-
struct sof_sink *sink)
476+
__cold int src_params_general(struct processing_module *mod,
477+
struct sof_source *source,
478+
struct sof_sink *sink)
479479
{
480480
struct comp_data *cd = module_get_private_data(mod);
481481
struct comp_dev *dev = mod->dev;
@@ -574,7 +574,7 @@ int src_params_general(struct processing_module *mod,
574574
return 0;
575575
}
576576

577-
int src_param_set(struct comp_dev *dev, struct comp_data *cd)
577+
__cold int src_param_set(struct comp_dev *dev, struct comp_data *cd)
578578
{
579579
struct src_param *a = &cd->param;
580580
int fs_in = cd->source_rate;
@@ -593,9 +593,9 @@ int src_param_set(struct comp_dev *dev, struct comp_data *cd)
593593
return 0;
594594
}
595595

596-
int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
597-
const struct src_stage *stage_src1,
598-
const struct src_stage *stage_src2)
596+
__cold int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
597+
const struct src_stage *stage_src1,
598+
const struct src_stage *stage_src2)
599599
{
600600
#if CONFIG_FAST_GET
601601
struct src_stage *stage_dst;
@@ -666,21 +666,21 @@ int src_process(struct processing_module *mod,
666666
return cd->src_func(cd, sources[0], sinks[0]);
667667
}
668668

669-
int src_set_config(struct processing_module *mod, uint32_t config_id,
670-
enum module_cfg_fragment_position pos, uint32_t data_offset_size,
671-
const uint8_t *fragment, size_t fragment_size, uint8_t *response,
672-
size_t response_size)
669+
__cold int src_set_config(struct processing_module *mod, uint32_t config_id,
670+
enum module_cfg_fragment_position pos, uint32_t data_offset_size,
671+
const uint8_t *fragment, size_t fragment_size, uint8_t *response,
672+
size_t response_size)
673673
{
674674
return -EINVAL;
675675
}
676676

677-
int src_get_config(struct processing_module *mod, uint32_t config_id,
678-
uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size)
677+
__cold int src_get_config(struct processing_module *mod, uint32_t config_id,
678+
uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size)
679679
{
680680
return -EINVAL;
681681
}
682682

683-
int src_reset(struct processing_module *mod)
683+
__cold int src_reset(struct processing_module *mod)
684684
{
685685
struct comp_data *cd = module_get_private_data(mod);
686686

src/audio/src/src_ipc4.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int src_stream_pcm_sink_rate_check(struct ipc4_config_src cfg,
7676
* set up param then verify param. BTW for IPC3 path, the param is sent by
7777
* host driver.
7878
*/
79-
int src_set_params(struct processing_module *mod, struct sof_sink *sink)
79+
__cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
8080
{
8181
struct sof_ipc_stream_params src_params;
8282
struct sof_ipc_stream_params *params = mod->stream_params;
@@ -116,8 +116,8 @@ int src_set_params(struct processing_module *mod, struct sof_sink *sink)
116116
return ret;
117117
}
118118

119-
void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
120-
struct sof_sink *sink)
119+
__cold void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
120+
struct sof_sink *sink)
121121
{
122122
struct processing_module *mod = comp_mod(dev);
123123
struct comp_data *cd = module_get_private_data(mod);
@@ -135,9 +135,9 @@ void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
135135
sink_set_rate(sink, cd->ipc_config.sink_rate);
136136
}
137137

138-
int src_prepare_general(struct processing_module *mod,
139-
struct sof_source *source,
140-
struct sof_sink *sink)
138+
__cold int src_prepare_general(struct processing_module *mod,
139+
struct sof_source *source,
140+
struct sof_sink *sink)
141141
{
142142
struct comp_data *cd = module_get_private_data(mod);
143143
struct comp_dev *dev = mod->dev;

0 commit comments

Comments
 (0)