Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/audio/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,7 @@ static struct comp_driver comp_dai = {
},
};

void sys_comp_dai_init(void);

void sys_comp_dai_init(void)
static void sys_comp_dai_init(void)
{
comp_register(&comp_dai);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/eq_fir.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,7 @@ struct comp_driver comp_eq_fir = {
},
};

void sys_comp_eq_fir_init(void);

void sys_comp_eq_fir_init(void)
static void sys_comp_eq_fir_init(void)
{
comp_register(&comp_eq_fir);
}
Expand Down
3 changes: 1 addition & 2 deletions src/audio/eq_iir.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,8 @@ struct comp_driver comp_eq_iir = {
},
};

void sys_comp_eq_iir_init(void);

void sys_comp_eq_iir_init(void)
static void sys_comp_eq_iir_init(void)
{
comp_register(&comp_eq_iir);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,9 +855,7 @@ struct comp_driver comp_host = {
},
};

void sys_comp_host_init(void);

void sys_comp_host_init(void)
static void sys_comp_host_init(void)
{
comp_register(&comp_host);
}
Expand Down
5 changes: 2 additions & 3 deletions src/audio/kpb.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <sof/audio/kpb.h>
#include <sof/list.h>
#include <sof/audio/buffer.h>
#include <sof/ut.h>

static void kpb_event_handler(int message, void *cb_data, void *event_data);
static int kpb_register_client(struct comp_data *kpb, struct kpb_client *cli);
Expand Down Expand Up @@ -545,9 +546,7 @@ struct comp_driver comp_kpb = {
},
};

void sys_comp_kpb_init(void);

void sys_comp_kpb_init(void)
UT_STATIC void sys_comp_kpb_init(void)
{
comp_register(&comp_kpb);
}
Expand Down
5 changes: 2 additions & 3 deletions src/audio/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <sof/ipc.h>
#include <sof/audio/component.h>
#include <sof/audio/format.h>
#include <sof/ut.h>

#define trace_mixer(__e, ...) \
trace_event(TRACE_CLASS_MIXER, __e, ##__VA_ARGS__)
Expand Down Expand Up @@ -445,9 +446,7 @@ struct comp_driver comp_mixer = {
},
};

void sys_comp_mixer_init(void);

void sys_comp_mixer_init(void)
UT_STATIC void sys_comp_mixer_init(void)
{
comp_register(&comp_mixer);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ struct comp_driver comp_mux = {
},
};

void sys_comp_mux_init(void);

void sys_comp_mux_init(void)
static void sys_comp_mux_init(void)
{
comp_register(&comp_mux);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/selector.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,8 @@ struct comp_driver comp_selector = {
},
};

void sys_comp_selector_init(void);

/** \brief Initializes selector component. */
void sys_comp_selector_init(void)
static void sys_comp_selector_init(void)
{
comp_register(&comp_selector);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,9 +980,7 @@ struct comp_driver comp_src = {
},
};

void sys_comp_src_init(void);

void sys_comp_src_init(void)
static void sys_comp_src_init(void)
{
comp_register(&comp_src);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ struct comp_driver comp_switch = {
},
};

void sys_comp_switch_init(void);

void sys_comp_switch_init(void)
static void sys_comp_switch_init(void)
{
comp_register(&comp_switch);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/tone.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,7 @@ struct comp_driver comp_tone = {
},
};

void sys_comp_tone_init(void);

void sys_comp_tone_init(void)
static void sys_comp_tone_init(void)
{
comp_register(&comp_tone);
}
Expand Down
4 changes: 1 addition & 3 deletions src/audio/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,10 @@ struct comp_driver comp_volume = {
},
};

void sys_comp_volume_init(void);

/**
* \brief Initializes volume component.
*/
void sys_comp_volume_init(void)
static void sys_comp_volume_init(void)
{
comp_register(&comp_volume);
}
Expand Down
42 changes: 42 additions & 0 deletions src/include/sof/ut.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2019, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Intel Corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Janusz Jankowski <janusz.jankowski@linux.intel.com>
*/

#ifndef __INCLUDE_SOF_UT__
#define __INCLUDE_SOF_UT__

/* UT_STATIC makes function unit-testable (non-static) when built for unit tests
*/
#ifdef CHECK
#define UT_STATIC
#else
#define UT_STATIC static
#endif

#endif