Commit 84510052 authored by Vaibhav Agarwal's avatar Vaibhav Agarwal Committed by Greg Kroah-Hartman
Browse files

staging: greybus: audio: Avoid less than zero check for le32 variable



mixer control->info call back function checks for -ve values to rebase
min and max values. However, le32 variable is used to fetch values from
GB module FW. Thus negative value checking is not required. Fix this!!

Signed-off-by: default avatarVaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: default avatarMark Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e965af6b
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -371,11 +371,7 @@ static int gbcodec_mixer_dapm_ctl_info(struct snd_kcontrol *kcontrol,
		uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;

	uinfo->count = data->vcount;
	uinfo->value.integer.min = 0;
	if (info->value.integer.min < 0 &&
	    (uinfo->type == SNDRV_CTL_ELEM_TYPE_INTEGER))
		uinfo->value.integer.max = platform_max - platform_min;
	else
	uinfo->value.integer.min = platform_min;
	uinfo->value.integer.max = platform_max;

	return 0;