alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [ALSA-LIB PATCH] topology: Use bool parser to parse boolean value
@ 2020-04-17 16:47 Amadeusz Sławiński
  2020-04-30 12:22 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Amadeusz Sławiński @ 2020-04-17 16:47 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, Amadeusz Sławiński

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

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 src/topology/dapm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/topology/dapm.c b/src/topology/dapm.c
index 70645126..cd1a8770 100644
--- a/src/topology/dapm.c
+++ b/src/topology/dapm.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [ALSA-LIB PATCH] topology: Use bool parser to parse boolean value
  2020-04-17 16:47 [ALSA-LIB PATCH] topology: Use bool parser to parse boolean value Amadeusz Sławiński
@ 2020-04-30 12:22 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2020-04-30 12:22 UTC (permalink / raw)
  To: Amadeusz Sławiński; +Cc: alsa-devel

Dne 17. 04. 20 v 18:47 Amadeusz Sławiński napsal(a):
> It should be safe to change this as correct values with int would be 0
> or 1 and bool parser handles them correctly.
> 
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

Applied thanks.

				Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-30 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 16:47 [ALSA-LIB PATCH] topology: Use bool parser to parse boolean value Amadeusz Sławiński
2020-04-30 12:22 ` Jaroslav Kysela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).