Re: [PATCH v1 2/2] sound: lpass-platform: Move dma channel allocation to pcmops

From: kbuild test robot
Date: Mon Jun 13 2016 - 09:40:20 EST


Hi,

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v4.7-rc3 next-20160609]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Srinivas-Kandagatla/sound-lpass-cpu-add-module-licence-and-description/20160613-212531
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.

All warnings (new ones prefixed by >>):

sound/soc/qcom/lpass-platform.c: In function 'lpass_platform_pcmops_close':
>> sound/soc/qcom/lpass-platform.c:128:21: warning: array subscript is below array bounds [-Warray-bounds]
drvdata->substream[ch] = substream;
^

vim +128 sound/soc/qcom/lpass-platform.c

112 if (ch >= 0 && v->free_dma_channel)
113 v->free_dma_channel(drvdata, ch);
114
115 return ret;
116 }
117
118 static int lpass_platform_pcmops_close(struct snd_pcm_substream *substream)
119 {
120 struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
121 struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime);
122 struct lpass_data *drvdata =
123 snd_soc_platform_get_drvdata(soc_runtime->platform);
124 struct lpass_variant *v = drvdata->variant;
125 int ch = -1;
126
127 if (v->free_dma_channel) {
> 128 drvdata->substream[ch] = substream;
129
130 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
131 ch = pcm_data->rdma_ch;
132 else
133 ch = pcm_data->wrdma_ch;
134
135 if (ch >= 0)
136 v->free_dma_channel(drvdata, ch);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: Binary data