[13/14] ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition
diff mbox series

Message ID 878so88o1t.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series
  • ASoC: soc-core cleanup step6
Related show

Commit Message

Kuninori Morimoto Nov. 22, 2019, 5:42 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current soc_set_name_prefix() for loop is checking both codec_conf
pointer and its number

	for (...; i < card->num_configs && card->codec_conf; ...)

But, if card->num_configs exists but card->codec_conf was NULL,
it is just bug.
This patch cleanups for loop condition.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 843bfe1..af33fbc 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1211,7 +1211,7 @@  static void soc_set_name_prefix(struct snd_soc_card *card,
 {
 	int i;
 
-	for (i = 0; i < card->num_configs && card->codec_conf; i++) {
+	for (i = 0; i < card->num_configs; i++) {
 		struct snd_soc_codec_conf *map = &card->codec_conf[i];
 		struct device_node *of_node = soc_component_to_node(component);