From 4403c71b96f43fa39b8f61635d70245e5e698c09 Mon Sep 17 00:00:00 2001 From: pmedawala Date: Mon, 30 Oct 2023 15:46:57 +0000 Subject: [PATCH] sound: tegra-safety-audio: Fix CERT C issues Fix the following CIDs: CID 689175 CID 689167 CID 689171 Bug 3959323 Change-Id: I86ebee06eb0f06f8f8424fc62b94a079b8e9fe80 Signed-off-by: pmedawala Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3006590 Reviewed-by: Uday Gupta Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- sound/tegra-safety-audio/sound-card.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/tegra-safety-audio/sound-card.c b/sound/tegra-safety-audio/sound-card.c index 65be9d88..404fceb4 100644 --- a/sound/tegra-safety-audio/sound-card.c +++ b/sound/tegra-safety-audio/sound-card.c @@ -98,7 +98,7 @@ static int alwayson_control_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *uc) { int rx = (int)kctl->private_value & 1; - int id = (int)kctl->private_value >> 1; + uint32_t id = (uint32_t)kctl->private_value >> 1; int enable = uc->value.integer.value[0]; struct i2s_config *i2s_config = &i2s[id].config; @@ -120,7 +120,7 @@ static int alwayson_control_get(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *uc) { int rx = (int)kctl->private_value & 1; - int id = (int)kctl->private_value >> 1; + uint32_t id = (uint32_t)kctl->private_value >> 1; struct i2s_config *i2s_config = &i2s[id].config; if (rx) @@ -208,7 +208,7 @@ static const struct snd_kcontrol_new controls_i2s8[] = { static int safety_i2s_add_kcontrols(struct snd_card *card, int id) { - int num_of_controls, i, ret; + int num_of_controls, i = 0, ret = 0; if (id == 0) { num_of_controls = ARRAY_SIZE(controls_i2s7);