diff mbox series

ASoC: fix code redundancy in sound/soc/soc-dapm.c

Message ID 20241015070826.5933-1-liujing@cmss.chinamobile.com (mailing list archive)
State New, archived
Headers show
Series ASoC: fix code redundancy in sound/soc/soc-dapm.c | expand

Commit Message

liujing Oct. 15, 2024, 7:08 a.m. UTC
In the dapm_widget_power_check function, the logic for assigning the value of w->new_power can be simplified
using the conditional operator

Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
---
 sound/soc/soc-dapm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 9330f1a3f758..865940de32c5 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1428,11 +1428,7 @@  static int dapm_widget_power_check(struct snd_soc_dapm_widget *w)
 	if (w->power_checked)
 		return w->new_power;
 
-	if (w->force)
-		w->new_power = 1;
-	else
-		w->new_power = w->power_check(w);
-
+	w->new_power = w->force ? 1 : w->power_check(w);
 	w->power_checked = true;
 
 	return w->new_power;