[alsa-devel] [PATCH v2 12/25] ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Aug 7 03:31:19 CEST 2019


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

list_for_each_entry_safe() will do nothing if it was empty list.
This patch removes unneeded list_empty() check for
list_for_each_entry_safe().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
v1 -> v2

	- no change

 sound/soc/soc-core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index eb4a247..5f23207 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2807,12 +2807,9 @@ static void snd_soc_try_rebind_card(void)
 {
 	struct snd_soc_card *card, *c;
 
-	if (!list_empty(&unbind_card_list)) {
-		list_for_each_entry_safe(card, c, &unbind_card_list, list) {
-			if (!snd_soc_bind_card(card))
-				list_del(&card->list);
-		}
-	}
+	list_for_each_entry_safe(card, c, &unbind_card_list, list)
+		if (!snd_soc_bind_card(card))
+			list_del(&card->list);
 }
 
 int snd_soc_add_component(struct device *dev,
-- 
2.7.4



More information about the Alsa-devel mailing list