diff options
author | Mark Brown | 2021-10-27 15:57:28 +0100 |
---|---|---|
committer | Mark Brown | 2021-10-27 15:57:28 +0100 |
commit | 192cf41fefad0d5ac11e426038b24210ec0cca0d (patch) | |
tree | 6adcb37c99c14c42913a89a0dcbe6227b2b2c5af /sound | |
parent | 709d297503e64ec3804b3b8150628656db164d4b (diff) | |
parent | f913582190ddfe2380ecf8ee87b4ff2c8dcb5d48 (diff) |
Merge series "ASoC: minor cleanup of warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Sparse, make W=1 and cppcheck all report minor warnings.
The only functional change is in patch7 where the error code is now
returned to the caller.
Pierre-Louis Bossart (8):
ASoC: topology: handle endianness warning
ASoC: rt5682s: use 'static' qualifier
ASoC: nau8821: fix kernel-doc
ASoC: nau8821: clarify out-of-bounds check
ASoC: mediatek: remove unnecessary initialization
ASoC: mediatek: mt8195: rename shadowed array
ASoC: mediatek: mt8195: fix return value
ASoC: rockchip: i2s_tdm: improve return value handling
sound/soc/codecs/nau8821.c | 6 ++++--
sound/soc/codecs/rt5682s.c | 6 +++---
sound/soc/mediatek/common/mtk-afe-fe-dai.c | 2 +-
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 4 ++--
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 2 +-
sound/soc/rockchip/rockchip_i2s_tdm.c | 2 +-
sound/soc/soc-topology.c | 2 +-
7 files changed, 13 insertions(+), 11 deletions(-)
--
2.25.1
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/nau8821.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/rt5682s.c | 6 | ||||
-rw-r--r-- | sound/soc/mediatek/common/mtk-afe-fe-dai.c | 2 | ||||
-rw-r--r-- | sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 4 | ||||
-rw-r--r-- | sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 2 | ||||
-rw-r--r-- | sound/soc/rockchip/rockchip_i2s_tdm.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-topology.c | 2 |
7 files changed, 13 insertions, 11 deletions
diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c index 4ea56d2f9509..2de818377484 100644 --- a/sound/soc/codecs/nau8821.c +++ b/sound/soc/codecs/nau8821.c @@ -381,7 +381,7 @@ static int dmic_clock_control(struct snd_soc_dapm_widget *w, speed_selection = dmic_speed_sel[i].val; break; } - if (speed_selection < 0) + if (i == 4) return -EINVAL; dev_dbg(nau8821->dev, @@ -1178,7 +1178,9 @@ static void nau8821_fll_apply(struct nau8821 *nau8821, /** * nau8821_set_fll - FLL configuration of nau8821 - * @codec: codec component + * @component: codec component + * @pll_id: PLL requested + * @source: clock source * @freq_in: frequency of input clock source * @freq_out: must be 256*Fs in order to achieve the best performance * diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index f6435b233a51..470957fcad6b 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -41,7 +41,7 @@ static const struct rt5682s_platform_data i2s_default_platform_data = { .dai_clk_names[RT5682S_DAI_BCLK_IDX] = "rt5682-dai-bclk", }; -const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES] = { +static const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES] = { "AVDD", "MICVDD", }; @@ -71,7 +71,7 @@ static void rt5682s_apply_patch_list(struct rt5682s_priv *rt5682s, dev_warn(dev, "Failed to apply regmap patch: %d\n", ret); } -const struct reg_default rt5682s_reg[] = { +static const struct reg_default rt5682s_reg[] = { {0x0002, 0x8080}, {0x0003, 0x0001}, {0x0005, 0x0000}, @@ -2838,7 +2838,7 @@ static int rt5682s_resume(struct snd_soc_component *component) #define rt5682s_resume NULL #endif -const struct snd_soc_dai_ops rt5682s_aif1_dai_ops = { +static const struct snd_soc_dai_ops rt5682s_aif1_dai_ops = { .hw_params = rt5682s_hw_params, .set_fmt = rt5682s_set_dai_fmt, .set_tdm_slot = rt5682s_set_tdm_slot, diff --git a/sound/soc/mediatek/common/mtk-afe-fe-dai.c b/sound/soc/mediatek/common/mtk-afe-fe-dai.c index 4f2c2379531b..395be97f13ae 100644 --- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c +++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c @@ -350,7 +350,7 @@ int mtk_afe_resume(struct snd_soc_component *component) struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); struct device *dev = afe->dev; struct regmap *regmap = afe->regmap; - int i = 0; + int i; if (pm_runtime_status_suspended(dev) || !afe->suspended) return 0; diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c index df8b90baf981..2bb05a828e8d 100644 --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c @@ -2232,7 +2232,7 @@ static const struct mtk_base_memif_data memif_data[MT8195_AFE_MEMIF_NUM] = { }, }; -static const struct mtk_base_irq_data irq_data[MT8195_AFE_IRQ_NUM] = { +static const struct mtk_base_irq_data irq_data_array[MT8195_AFE_IRQ_NUM] = { [MT8195_AFE_IRQ_1] = { .id = MT8195_AFE_IRQ_1, .irq_cnt_reg = -1, @@ -3100,7 +3100,7 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev) return -ENOMEM; for (i = 0; i < afe->irqs_size; i++) - afe->irqs[i].irq_data = &irq_data[i]; + afe->irqs[i].irq_data = &irq_data_array[i]; /* init memif */ afe->memif_size = MT8195_AFE_MEMIF_NUM; diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c index ac591d453e1e..c02c10da3600 100644 --- a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c +++ b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c @@ -1316,7 +1316,7 @@ static int mt8195_afe_disable_etdm(struct mtk_base_afe *afe, int dai_id) } out: spin_unlock_irqrestore(&afe_priv->afe_ctrl_lock, flags); - return 0; + return ret; } static int etdm_cowork_slv_sel(int id, int slave_mode) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index e8dee1f95d85..17b9b287853a 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -596,7 +596,7 @@ static int rockchip_i2s_tdm_clk_set_rate(struct rk_i2s_tdm_dev *i2s_tdm, i2s_tdm->clk_ppm = ppm; - return ret; + return 0; } static int rockchip_i2s_tdm_calibrate_mclk(struct rk_i2s_tdm_dev *i2s_tdm, diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 88f849b119da..7a4559ddf903 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1485,7 +1485,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, if (!kcontrol_type) goto err; - for (i = 0; i < w->num_kcontrols; i++) { + for (i = 0; i < le32_to_cpu(w->num_kcontrols); i++) { control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos; switch (le32_to_cpu(control_hdr->ops.info)) { case SND_SOC_TPLG_CTL_VOLSW: |