Skip to contentSkip to conversation

ASoC: soc-card: remove card check

PATCH In review Kuninori Morimoto 2 participants 2 messages Jan 8, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: soc-card: remove card check

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.

---
v1 -> v2
- rebase to latest asoc/for-6.14

 sound/soc/soc-card.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-card.c +2 -2
index 8e9546fe74281..e6eb71b3010a8 100644
@@ -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);
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 11 lines · Kuninori Morimoto

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(...);
		...
	}
Quoted 1 line

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: soc-card: remove card check

      commit: 9c3d68ce5dee76f30b23ca29b2be4774e291f7f1

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark