lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1637219231-406-6-git-send-email-spujar@nvidia.com>
Date:   Thu, 18 Nov 2021 12:37:00 +0530
From:   Sameer Pujar <spujar@...dia.com>
To:     <broonie@...nel.org>, <lgirdwood@...il.com>, <perex@...ex.cz>,
        <tiwai@...e.com>
CC:     <thierry.reding@...il.com>, <jonathanh@...dia.com>,
        <alsa-devel@...a-project.org>, <linux-tegra@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, Sameer Pujar <spujar@...dia.com>
Subject: [PATCH v3 05/16] ASoC: tegra: Fix wrong value type in SFC

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: b2f74ec53a6c ("ASoC: tegra: Add Tegra210 based SFC driver")
Suggested-by: Takashi Iwai <tiwai@...e.de>
Signed-off-by: Sameer Pujar <spujar@...dia.com>
---
 sound/soc/tegra/tegra210_sfc.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/sound/soc/tegra/tegra210_sfc.c b/sound/soc/tegra/tegra210_sfc.c
index dc477ee..cb592ef 100644
--- a/sound/soc/tegra/tegra210_sfc.c
+++ b/sound/soc/tegra/tegra210_sfc.c
@@ -3251,16 +3251,16 @@ static int tegra210_sfc_get_control(struct snd_kcontrol *kcontrol,
 	struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt);
 
 	if (strstr(kcontrol->id.name, "Input Stereo To Mono"))
-		ucontrol->value.integer.value[0] =
+		ucontrol->value.enumerated.item[0] =
 			sfc->stereo_to_mono[SFC_RX_PATH];
 	else if (strstr(kcontrol->id.name, "Input Mono To Stereo"))
-		ucontrol->value.integer.value[0] =
+		ucontrol->value.enumerated.item[0] =
 			sfc->mono_to_stereo[SFC_RX_PATH];
 	else if (strstr(kcontrol->id.name, "Output Stereo To Mono"))
-		ucontrol->value.integer.value[0] =
+		ucontrol->value.enumerated.item[0] =
 			sfc->stereo_to_mono[SFC_TX_PATH];
 	else if (strstr(kcontrol->id.name, "Output Mono To Stereo"))
-		ucontrol->value.integer.value[0] =
+		ucontrol->value.enumerated.item[0] =
 			sfc->mono_to_stereo[SFC_TX_PATH];
 
 	return 0;
@@ -3271,16 +3271,19 @@ static int tegra210_sfc_put_control(struct snd_kcontrol *kcontrol,
 {
 	struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
 	struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt);
-	int value = ucontrol->value.integer.value[0];
 
 	if (strstr(kcontrol->id.name, "Input Stereo To Mono"))
-		sfc->stereo_to_mono[SFC_RX_PATH] = value;
+		sfc->stereo_to_mono[SFC_RX_PATH] =
+			ucontrol->value.enumerated.item[0];
 	else if (strstr(kcontrol->id.name, "Input Mono To Stereo"))
-		sfc->mono_to_stereo[SFC_RX_PATH] = value;
+		sfc->mono_to_stereo[SFC_RX_PATH] =
+			ucontrol->value.enumerated.item[0];
 	else if (strstr(kcontrol->id.name, "Output Stereo To Mono"))
-		sfc->stereo_to_mono[SFC_TX_PATH] = value;
+		sfc->stereo_to_mono[SFC_TX_PATH] =
+			ucontrol->value.enumerated.item[0];
 	else if (strstr(kcontrol->id.name, "Output Mono To Stereo"))
-		sfc->mono_to_stereo[SFC_TX_PATH] = value;
+		sfc->mono_to_stereo[SFC_TX_PATH] =
+			ucontrol->value.enumerated.item[0];
 	else
 		return 0;
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ