Skip to contentSkip to conversation

topology: Use bool parser to parse boolean value

PATCH In review Amadeusz Sławiński 2 participants 2 messages Apr 17, 2020 – Apr 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 topology: Use bool parser to parse boolean value

It should be safe to change this as correct values with int would be 0 or 1 and bool parser handles them correctly.

---
 src/topology/dapm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/topology/dapm.c +2 -1
index 70645126..cd1a8770 100644
@@ -595,7 +595,8 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg,
 		}
 
 		if (strcmp(id, "invert") == 0) {
-			if (tplg_get_integer(n, &ival, 0))
+			ival = snd_config_get_bool(n);
+			if (ival < 0)
 				return -EINVAL;
 
 			widget->invert = ival;
Signature · 1 line
2.17.1
#1 lore raw

Dne 17. 04. 20 v 18:47 Amadeusz Sławiński napsal(a):

Quoted 4 lines

It should be safe to change this as correct values with int would be 0 or 1 and bool parser handles them correctly.

Applied thanks.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.