Re: [alsa-devel] [PATCH 04/10] ASoC: img: Add driver for I2S output controller

From: kbuild test robot
Date: Wed Sep 30 2015 - 11:43:24 EST


Hi Damien.Horsley,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore]

config: x86_64-allmodconfig (attached as .config)
reproduce:
git checkout 5037c15dd47c86ab337b73c7f9ffcabe1bb86f3b
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

sound/soc/img/img-i2s-out.c:218:16: sparse: incorrect type in assignment (different base types)
sound/soc/img/img-i2s-out.c:218:16: expected unsigned int [unsigned] format
sound/soc/img/img-i2s-out.c:218:16: got restricted snd_pcm_format_t
sound/soc/img/img-i2s-out.c:222:23: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/img/img-i2s-out.c: In function 'img_i2s_out_hw_params':
>> sound/soc/img/img-i2s-out.c:263:17: warning: large integer implicitly truncated to unsigned type [-Woverflow]
control_mask = ~IMG_I2S_OUT_CTL_CLK_MASK &
^
sound/soc/img/img-i2s-out.c: In function 'img_i2s_out_set_fmt':
sound/soc/img/img-i2s-out.c:336:17: warning: large integer implicitly truncated to unsigned type [-Woverflow]
control_mask = ~IMG_I2S_OUT_CTL_CLK_EN_MASK &
^
sound/soc/img/img-i2s-out.c:341:22: warning: large integer implicitly truncated to unsigned type [-Woverflow]
chan_control_mask = ~IMG_I2S_OUT_CHAN_CTL_CLKT_MASK;
^

sparse warnings: (new ones prefixed by >>)

>> sound/soc/img/img-i2s-out.c:218:16: sparse: incorrect type in assignment (different base types)
sound/soc/img/img-i2s-out.c:218:16: expected unsigned int [unsigned] format
sound/soc/img/img-i2s-out.c:218:16: got restricted snd_pcm_format_t
>> sound/soc/img/img-i2s-out.c:222:23: sparse: restricted snd_pcm_format_t degrades to integer
sound/soc/img/img-i2s-out.c: In function 'img_i2s_out_hw_params':
sound/soc/img/img-i2s-out.c:263:17: warning: large integer implicitly truncated to unsigned type [-Woverflow]
control_mask = ~IMG_I2S_OUT_CTL_CLK_MASK &
^
sound/soc/img/img-i2s-out.c: In function 'img_i2s_out_set_fmt':
sound/soc/img/img-i2s-out.c:336:17: warning: large integer implicitly truncated to unsigned type [-Woverflow]
control_mask = ~IMG_I2S_OUT_CTL_CLK_EN_MASK &
^
sound/soc/img/img-i2s-out.c:341:22: warning: large integer implicitly truncated to unsigned type [-Woverflow]
chan_control_mask = ~IMG_I2S_OUT_CHAN_CTL_CLKT_MASK;
^

vim +263 sound/soc/img/img-i2s-out.c

212 unsigned int channels, i2s_channels, format;
213 long pre_div_a, pre_div_b, diff_a, diff_b, rate, clk_rate;
214 int i;
215 u32 reg, control_reg, control_mask, control_set = 0;
216
217 rate = params_rate(params);
> 218 format = params_format(params);
219 channels = params_channels(params);
220 i2s_channels = channels / 2;
221
> 222 if (format != SNDRV_PCM_FORMAT_S32_LE)
223 return -EINVAL;
224
225 if ((channels < 2) ||
226 (channels > (i2s->max_i2s_chan * 2)) ||
227 (channels % 2))
228 return -EINVAL;
229
230 pre_div_a = clk_round_rate(i2s->clk_ref, rate * 256);
231 if (pre_div_a < 0)
232 return pre_div_a;
233 pre_div_b = clk_round_rate(i2s->clk_ref, rate * 384);
234 if (pre_div_b < 0)
235 return pre_div_b;
236
237 diff_a = abs((pre_div_a / 256) - rate);
238 diff_b = abs((pre_div_b / 384) - rate);
239
240 /* If diffs are equal, use lower clock rate */
241 if (diff_a > diff_b)
242 clk_set_rate(i2s->clk_ref, pre_div_b);
243 else
244 clk_set_rate(i2s->clk_ref, pre_div_a);
245
246 /*
247 * Another driver (eg alsa machine driver) may have rejected the above
248 * change. Get the current rate and set the register bit according to
249 * the new minimum diff
250 */
251 clk_rate = clk_get_rate(i2s->clk_ref);
252
253 diff_a = abs((clk_rate / 256) - rate);
254 diff_b = abs((clk_rate / 384) - rate);
255
256 if (diff_a > diff_b)
257 control_set |= IMG_I2S_OUT_CTL_CLK_MASK;
258
259 control_set |= (((i2s_channels - 1) <<
260 IMG_I2S_OUT_CTL_ACTIVE_CHAN_SHIFT) &
261 IMG_I2S_OUT_CTL_ACTIVE_CHAN_MASK);
262
> 263 control_mask = ~IMG_I2S_OUT_CTL_CLK_MASK &
264 ~IMG_I2S_OUT_CTL_ACTIVE_CHAN_MASK;
265
266 control_reg = img_i2s_out_disable(i2s);

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

Attachment: .config.gz
Description: Binary data