Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c9a56c5 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

ASoC: msm: qdsp6v2: Fix impossible check



We assign the long type here to bool, so it can only be true or
false, not negative. Replace the impossible check with the
correct one, which makes sure that only 0 or a positive integer
is used as an argument here. This also removes a warning on newer
compilers.

Change-Id: If31c160a241b7389038288bfee3986a060fcc959
CRs-Fixed: 1099676
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent fd8f40e6
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -394,12 +394,13 @@ static int msm_voice_sidetone_put(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	int ret;
	bool sidetone_enable = ucontrol->value.integer.value[0];
	long value = ucontrol->value.integer.value[0];
	bool sidetone_enable = value;
	uint32_t session_id = ALL_SESSION_VSID;

	if (sidetone_enable < 0) {
		pr_err("%s: Invalid arguments sidetone enable %d\n",
			 __func__, sidetone_enable);
	if (value < 0) {
		pr_err("%s: Invalid arguments sidetone enable %ld\n",
			 __func__, value);
		ret = -EINVAL;
		return ret;
	}