linux-stable/sound/soc/mediatek
Trevor Wu 66b9e94cb7
ASoC: mediatek: mt8188: remove etdm dead code
Some Smatch static checker warning like below was found.

sound/soc/mediatek/mt8188/mt8188-dai-etdm.c:2487
mt8188_dai_etdm_parse_of()
warn: 'ret' returned from snprintf() might be larger than 48

    2479         for (i = 0; i < MT8188_AFE_IO_ETDM_NUM; i++) {
    2480                 dai_id = ETDM_TO_DAI_ID(i);
    2481                 etdm_data = afe_priv->dai_priv[dai_id];
    2482
    2483                 ret = snprintf(prop, sizeof(prop),
    2484                                "mediatek,%s-multi-pin-mode",
    2485                                of_afe_etdms[i].name);
    2486                 if (ret < 0) {
--> 2487                         dev_err(afe->dev, "%s snprintf
err=%d\n",
    2488

In linux kernel, snprintf() never returns negatives. On the other hand,
the format string like "mediatek,%s-multi-pin-mode" must be smaller
than sizeof(prop)=48.

After discussing in the mail thread[1], I remove the dead code to fix
the Smatch warnings.

[1]: https://lore.kernel.org/all/Y9EdBg641tJDDrt%2F@kili/

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230202103704.15626-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-03 12:03:57 +00:00
..
common ASoC: mediatek: use helper function 2023-01-31 11:05:02 +00:00
mt2701 ASoC: mediatek: mt2701-wm8960: Register to module device table 2022-11-09 13:44:24 +00:00
mt6797 ASoC: mediatek: use helper function 2023-01-31 11:05:02 +00:00
mt8173 ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in mt8173_rt5650_rt5514_dev_probe() 2022-12-07 14:19:11 +00:00
mt8183 ASoC: mediatek: use helper function 2023-01-31 11:05:02 +00:00
mt8186 ASoC: mediatek: use helper function 2023-01-31 11:05:02 +00:00
mt8188 ASoC: mediatek: mt8188: remove etdm dead code 2023-02-03 12:03:57 +00:00
mt8192 ASoC: mediatek: use helper function 2023-01-31 11:05:02 +00:00
mt8195 ASoC: mediatek: use helper function 2023-01-31 11:05:02 +00:00
Kconfig ASoC: mediatek: Add support for MT8188 SoC 2023-01-19 15:31:47 +00:00
Makefile ASoC: mediatek: mt8188: add platform driver 2023-01-16 11:16:26 +00:00