From f1a7ecab50058d43ce207ec17384f437ee77373a Mon Sep 17 00:00:00 2001 From: Deru Wang Date: Tue, 19 May 2020 20:55:01 +0800 Subject: [PATCH] asoc: flags is used but is uninitialized initialize flags to resolve static code analysis issue Change-Id: I23e74050e69db6894b02cbc00605861abdce0e56 Signed-off-by: Deru Wang --- asoc/msm-lsm-client.c | 2 +- asoc/msm-pcm-afe-v2.c | 4 ++-- asoc/msm-pcm-dtmf-v2.c | 6 +++--- asoc/msm-pcm-host-voice-v2.c | 10 +++++----- asoc/msm-pcm-voip-v2.c | 10 +++++----- asoc/msm-qti-pp-config.c | 4 ++-- ipc/apr_tal_rpmsg.c | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/asoc/msm-lsm-client.c b/asoc/msm-lsm-client.c index 017323161dcd..1265d5c997a3 100644 --- a/asoc/msm-lsm-client.c +++ b/asoc/msm-lsm-client.c @@ -1252,7 +1252,7 @@ static int msm_lsm_ioctl_shared(struct snd_pcm_substream *substream, unsigned int cmd, void *arg) { struct snd_soc_pcm_runtime *rtd; - unsigned long flags; + unsigned long flags = 0; int ret; struct snd_lsm_sound_model_v2 snd_model_v2; struct snd_lsm_session_data session_data; diff --git a/asoc/msm-pcm-afe-v2.c b/asoc/msm-pcm-afe-v2.c index 5fe3b34a7953..db21565120e5 100644 --- a/asoc/msm-pcm-afe-v2.c +++ b/asoc/msm-pcm-afe-v2.c @@ -161,7 +161,7 @@ static void pcm_afe_process_tx_pkt(uint32_t opcode, void *priv) { struct pcm_afe_info *prtd = priv; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; struct snd_pcm_substream *substream = NULL; struct snd_pcm_runtime *runtime = NULL; uint16_t event; @@ -255,7 +255,7 @@ static void pcm_afe_process_rx_pkt(uint32_t opcode, void *priv) { struct pcm_afe_info *prtd = priv; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; struct snd_pcm_substream *substream = NULL; struct snd_pcm_runtime *runtime = NULL; struct snd_soc_pcm_runtime *rtd = NULL; diff --git a/asoc/msm-pcm-dtmf-v2.c b/asoc/msm-pcm-dtmf-v2.c index 3dc7a26a54c8..cda75b8fd9fc 100644 --- a/asoc/msm-pcm-dtmf-v2.c +++ b/asoc/msm-pcm-dtmf-v2.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2013-2014, 2017-2019 The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2014, 2017-2020 The Linux Foundation. All rights reserved. */ #include @@ -224,7 +224,7 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream, struct dtmf_buf_node *buf_node = NULL; struct snd_pcm_runtime *runtime = substream->runtime; struct dtmf_drv_info *prtd = runtime->private_data; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; ret = wait_event_interruptible_timeout(prtd->out_wait, (!list_empty(&prtd->out_queue)), @@ -324,7 +324,7 @@ static int msm_pcm_close(struct snd_pcm_substream *substream) struct snd_pcm_substream *c_substream; struct snd_pcm_runtime *runtime = substream->runtime; struct dtmf_drv_info *prtd = runtime->private_data; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; pr_debug("%s() DTMF\n", __func__); diff --git a/asoc/msm-pcm-host-voice-v2.c b/asoc/msm-pcm-host-voice-v2.c index 41c3982dd343..a5d44edbaf63 100644 --- a/asoc/msm-pcm-host-voice-v2.c +++ b/asoc/msm-pcm-host-voice-v2.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. */ #include @@ -678,7 +678,7 @@ static void hpcm_copy_capture_data_to_queue(struct dai_data *dai_data, uint32_t len) { struct hpcm_buf_node *buf_node = NULL; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; if (dai_data->substream == NULL) return; @@ -987,7 +987,7 @@ static int msm_pcm_close(struct snd_pcm_substream *substream) struct snd_dma_buffer *dma_buf; struct snd_pcm_runtime *runtime; struct hpcm_drv *prtd; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; struct dai_data *dai_data = NULL; struct tap_point *tp = NULL; struct tappnt_mxr_data *tmd = NULL; @@ -1077,7 +1077,7 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, struct snd_pcm_runtime *runtime = substream->runtime; struct hpcm_drv *prtd = runtime->private_data; struct dai_data *dai_data = hpcm_get_dai_data(substream->pcm->id, prtd); - unsigned long dsp_flags; + unsigned long dsp_flags = 0; if (dai_data == NULL) { pr_err("%s, dai_data is null\n", __func__); @@ -1129,7 +1129,7 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; struct hpcm_drv *prtd = runtime->private_data; struct dai_data *dai_data = hpcm_get_dai_data(substream->pcm->id, prtd); - unsigned long dsp_flags; + unsigned long dsp_flags = 0; if (dai_data == NULL) { pr_err("%s, dai_data is null\n", __func__); diff --git a/asoc/msm-pcm-voip-v2.c b/asoc/msm-pcm-voip-v2.c index e2ad13b4cc6c..f635a2b63fbe 100644 --- a/asoc/msm-pcm-voip-v2.c +++ b/asoc/msm-pcm-voip-v2.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include @@ -508,7 +508,7 @@ static void voip_process_dl_pkt(uint8_t *voc_pkt, void *private_data) { struct voip_buf_node *buf_node = NULL; struct voip_drv_info *prtd = private_data; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; uint32_t rate_type; uint32_t frame_rate; u32 pkt_len; @@ -778,7 +778,7 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, struct voip_buf_node *buf_node = NULL; struct snd_pcm_runtime *runtime = substream->runtime; struct voip_drv_info *prtd = runtime->private_data; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; pr_debug("%s: fbytes=%lu\n", __func__, fbytes); @@ -852,7 +852,7 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream, struct voip_buf_node *buf_node = NULL; struct snd_pcm_runtime *runtime = substream->runtime; struct voip_drv_info *prtd = runtime->private_data; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; int size; pr_debug("%s: fbytes = %lu\n", __func__, fbytes); @@ -941,7 +941,7 @@ static int msm_pcm_close(struct snd_pcm_substream *substream) struct snd_pcm_substream *p_substream, *c_substream; struct snd_pcm_runtime *runtime; struct voip_drv_info *prtd; - unsigned long dsp_flags; + unsigned long dsp_flags = 0; if (substream == NULL) { pr_err("substream is NULL\n"); diff --git a/asoc/msm-qti-pp-config.c b/asoc/msm-qti-pp-config.c index 8a5ebce6ec46..e26e421fe3ae 100644 --- a/asoc/msm-qti-pp-config.c +++ b/asoc/msm-qti-pp-config.c @@ -1200,7 +1200,7 @@ int msm_adsp_inform_mixer_ctl(struct snd_soc_pcm_runtime *rtd, int ctl_len = 0, ret = 0; struct dsp_stream_callback_list *new_event; struct dsp_stream_callback_list *oldest_event; - unsigned long spin_flags; + unsigned long spin_flags = 0; struct dsp_stream_callback_prtd *kctl_prtd = NULL; struct msm_adsp_event_data *event_data = NULL; const char *mixer_ctl_name = DSP_STREAM_CALLBACK; @@ -1309,7 +1309,7 @@ int msm_adsp_stream_callback_get(struct snd_kcontrol *kcontrol, { uint32_t payload_size = 0; struct dsp_stream_callback_list *oldest_event; - unsigned long spin_flags; + unsigned long spin_flags = 0; struct dsp_stream_callback_prtd *kctl_prtd = NULL; int ret = 0; diff --git a/ipc/apr_tal_rpmsg.c b/ipc/apr_tal_rpmsg.c index c8830d1c25cc..bb894e2f4bd2 100644 --- a/ipc/apr_tal_rpmsg.c +++ b/ipc/apr_tal_rpmsg.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. */ #include @@ -36,7 +36,7 @@ int apr_tal_write(struct apr_svc_ch_dev *apr_ch, void *data, struct apr_pkt_priv *pkt_priv, int len) { int rc = 0, retries = 0; - unsigned long flags; + unsigned long flags = 0; struct rpmsg_device *rpdev = NULL; if (!apr_ch || len > APR_MAX_BUF || @@ -186,7 +186,7 @@ static int apr_tal_rpmsg_callback(struct rpmsg_device *rpdev, void *data, int len, void *priv, u32 addr) { struct apr_svc_ch_dev *apr_ch = dev_get_drvdata(&rpdev->dev); - unsigned long flags; + unsigned long flags = 0; if (!apr_ch || !data) { pr_err("%s: Invalid apr_ch or ptr\n", __func__);