[PATCH] ASoC: soc-core: tidyup strcmp() param on snd_soc_is_matching_dai()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b11b2ca5d939..507cd3015ff4 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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 &&
-- 
2.25.1




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux