Skip to content

Commit 91745b0

Browse files
Colin Ian Kingbroonie
authored andcommitted
ASoC: mediatek: mt8195: make several arrays static const
Don't populate various arrays on the stack but instead make them static const. Also makes the object code smaller by a few hundred bytes. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20211129224236.506883-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 043c0a6 commit 91745b0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

sound/soc/mediatek/mt8195/mt8195-afe-clk.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ int mt8195_afe_enable_reg_rw_clk(struct mtk_base_afe *afe)
326326
{
327327
struct mt8195_afe_private *afe_priv = afe->platform_priv;
328328
int i;
329-
unsigned int clk_array[] = {
329+
static const unsigned int clk_array[] = {
330330
MT8195_CLK_SCP_ADSP_AUDIODSP, /* bus clock for infra */
331331
MT8195_CLK_TOP_AUDIO_H_SEL, /* clock for ADSP bus */
332332
MT8195_CLK_TOP_AUDIO_LOCAL_BUS_SEL, /* bus clock for DRAM access */
@@ -347,7 +347,7 @@ int mt8195_afe_disable_reg_rw_clk(struct mtk_base_afe *afe)
347347
{
348348
struct mt8195_afe_private *afe_priv = afe->platform_priv;
349349
int i;
350-
unsigned int clk_array[] = {
350+
static const unsigned int clk_array[] = {
351351
MT8195_CLK_AUD_A1SYS,
352352
MT8195_CLK_AUD_A1SYS_HP,
353353
MT8195_CLK_AUD_AFE,
@@ -380,11 +380,11 @@ static int mt8195_afe_enable_timing_sys(struct mtk_base_afe *afe)
380380
{
381381
struct mt8195_afe_private *afe_priv = afe->platform_priv;
382382
int i;
383-
unsigned int clk_array[] = {
383+
static const unsigned int clk_array[] = {
384384
MT8195_CLK_AUD_A1SYS,
385385
MT8195_CLK_AUD_A2SYS,
386386
};
387-
unsigned int cg_array[] = {
387+
static const unsigned int cg_array[] = {
388388
MT8195_TOP_CG_A1SYS_TIMING,
389389
MT8195_TOP_CG_A2SYS_TIMING,
390390
MT8195_TOP_CG_26M_TIMING,
@@ -403,11 +403,11 @@ static int mt8195_afe_disable_timing_sys(struct mtk_base_afe *afe)
403403
{
404404
struct mt8195_afe_private *afe_priv = afe->platform_priv;
405405
int i;
406-
unsigned int clk_array[] = {
406+
static const unsigned int clk_array[] = {
407407
MT8195_CLK_AUD_A2SYS,
408408
MT8195_CLK_AUD_A1SYS,
409409
};
410-
unsigned int cg_array[] = {
410+
static const unsigned int cg_array[] = {
411411
MT8195_TOP_CG_26M_TIMING,
412412
MT8195_TOP_CG_A2SYS_TIMING,
413413
MT8195_TOP_CG_A1SYS_TIMING,

0 commit comments

Comments
 (0)