Skip to content

Commit

Permalink
ASoC: soc-core: tidyup strcmp() param on snd_soc_is_matching_dai()
Browse files Browse the repository at this point in the history
snd_soc_is_matching_dai() checks DAI name, which is paired function
with snd_soc_dai_name_get().

It checks dlc->dai_name and dai->name (A) or dai->driver_name (B) or
dai->component->name (C)

	static int snd_soc_is_matching_dai(...)
	{
		...
		if (strcmp(dlc->dai_name, dai->name) == 0)
			   ~~~~~~~~~~~~~  ^^^^^^^^^(A)
		if (...
		    strcmp(dai->driver->name, dlc->dai_name) == 0)
			 (B)^^^^^^^^^^^^^^^^  ~~~~~~~~~~~~~
		if (...
		    strcmp(dlc->dai_name, dai->component->name) == 0)
			   ~~~~~~~~~~~~~  ^^^^^^^^^^^^^^^^^^(C)
		...
	}

But (B) part order is different with (A) and (C) (= ^^^^ and ~~~~).
This is not a big deal, but confusable to read. Fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87wmqxjbcg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Feb 22, 2024
1 parent 253ce07 commit b1724c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc,
return 1;

if (dai->driver->name &&
strcmp(dai->driver->name, dlc->dai_name) == 0)
strcmp(dlc->dai_name, dai->driver->name) == 0)
return 1;

if (dai->component->name &&
Expand Down

0 comments on commit b1724c0

Please sign in to comment.