diff mbox series

ASoC: codecs:rx-macro: Fixing uninitialized variables.

Message ID 20230316162249.17044-1-quic_visr@quicinc.com (mailing list archive)
State New, archived
Headers show
Series ASoC: codecs:rx-macro: Fixing uninitialized variables. | expand

Commit Message

Ravulapati Vishnu Vardhan Rao March 16, 2023, 4:22 p.m. UTC
Initializing the uninitialized variables to avoid any unexpected garbage
value to be propagated further.

Signed-off-by: Ravulapati Vishnu Vardhan Rao <quic_visr@quicinc.com>
---
 sound/soc/codecs/lpass-rx-macro.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown March 16, 2023, 4:31 p.m. UTC | #1
On Thu, Mar 16, 2023 at 09:52:49PM +0530, Ravulapati Vishnu Vardhan Rao wrote:

>  {
>  	u16 hd2_scale_reg, hd2_enable_reg;
> +	hd2_scale_reg = 0;
> +	hd2_enable_reg = 0;
>  
>  	switch (interp_idx) {
>  	case INTERP_HPHL:

This is just shutting the warning up, it's not like 0 is ever a sensible
value to use there.
diff mbox series

Patch

diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index a73a7d7a1c0a..0c8b79ff2fc5 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -2219,6 +2219,8 @@  static void rx_macro_hd2_control(struct snd_soc_component *component,
 				 u16 interp_idx, int event)
 {
 	u16 hd2_scale_reg, hd2_enable_reg;
+	hd2_scale_reg = 0;
+	hd2_enable_reg = 0;
 
 	switch (interp_idx) {
 	case INTERP_HPHL: