From: Kuninori Morimoto Date: Wed, 7 Aug 2019 01:31:19 +0000 (+0900) Subject: ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b245d273cbcd64eeaa93305f99c4ea8a6baf9c89;p=openwrt%2Fstaging%2Fblogic.git ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card() 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 Link: https://lore.kernel.org/r/878ss5aho6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index cf3d967d731e..6b0042835233 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2808,12 +2808,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,