]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: soc-card: remove card check
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 8 Jan 2025 03:05:52 +0000 (03:05 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 8 Jan 2025 12:36:56 +0000 (12:36 +0000)
only snd_soc_card_set_bias_level() and snd_soc_card_set_bias_level_post()
are checking "card" in the function, like below

int snd_soc_card_set_bias_level(...)
{
...
=> if (card && card->xxx)
ret = card->xxxx(...);
...
}

But it should already have been an error if "card" was NULL.
remove "card" NULL check here. Otherwise it will get waring on
smatch without this patch. This is prepare for error check cleanup.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87msg2knsg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-card.c

index 8e9546fe74281232673dc11a31ac0de393f9a7af..e6eb71b3010a83fc070f9ad8c560526c92d30efb 100644 (file)
@@ -219,7 +219,7 @@ int snd_soc_card_set_bias_level(struct snd_soc_card *card,
 {
        int ret = 0;
 
-       if (card && card->set_bias_level)
+       if (card->set_bias_level)
                ret = card->set_bias_level(card, dapm, level);
 
        return soc_card_ret(card, ret);
@@ -231,7 +231,7 @@ int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
 {
        int ret = 0;
 
-       if (card && card->set_bias_level_post)
+       if (card->set_bias_level_post)
                ret = card->set_bias_level_post(card, dapm, level);
 
        return soc_card_ret(card, ret);