From: kernel test robot <lkp@intel.com>
To: Ryan Lee <ryan.lee.analog@gmail.com>,
lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org,
krzk+dt@kernel.org, perex@perex.cz, tiwai@suse.com,
srinivas.kandagatla@linaro.org, ckeepax@opensource.cirrus.com,
tanureal@opensource.cirrus.com, cy_huang@richtek.com,
pierre-louis.bossart@linux.intel.com,
drhodes@opensource.cirrus.com, pbrobinson@gmail.com,
hdegoede@redhat.com, lukas.bulwahn@gmail.com,
stephan@gerhold.net, arnd@arndb.de, alsa-devel@alsa-project.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
ryans.lee@analog.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH V2 2/2] ASoC: max98396: add amplifier driver
Date: Fri, 22 Apr 2022 15:06:01 +0800 [thread overview]
Message-ID: <202204221550.phNeKLyn-lkp@intel.com> (raw)
In-Reply-To: <20220421230253.823798-2-ryan.lee.analog@gmail.com>
Hi Ryan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on v5.18-rc3 next-20220421]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Ryan-Lee/ASoC-dt-bindings-max98396-add-amplifier-driver/20220422-070610
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: arm-buildonly-randconfig-r003-20220421 (https://download.01.org/0day-ci/archive/20220422/202204221550.phNeKLyn-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/1acb9ac9acbd834a2e93c2127be6bdd1716dc6dd
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Ryan-Lee/ASoC-dt-bindings-max98396-add-amplifier-driver/20220422-070610
git checkout 1acb9ac9acbd834a2e93c2127be6bdd1716dc6dd
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash sound/soc/codecs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> sound/soc/codecs/max98396.c:408:7: warning: variable 'update' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (format != (reg & MAX98396_PCM_MODE_CFG_FORMAT_MASK))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/max98396.c:411:7: note: uninitialized use occurs here
if (update)
^~~~~~
sound/soc/codecs/max98396.c:408:3: note: remove the 'if' if its condition is always true
if (format != (reg & MAX98396_PCM_MODE_CFG_FORMAT_MASK))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/max98396.c:349:13: note: initialize the variable 'update' to silence this warning
bool update;
^
= 0
1 warning generated.
vim +408 sound/soc/codecs/max98396.c
339
340 static int max98396_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
341 {
342 struct snd_soc_component *component = codec_dai->component;
343 struct max98396_priv *max98396 = snd_soc_component_get_drvdata(component);
344 unsigned int format;
345 unsigned int bclk_pol = 0;
346 unsigned int fsync_pol = 0;
347 int ret, status;
348 int reg;
349 bool update;
350
351 dev_dbg(component->dev, "%s: fmt 0x%08X\n", __func__, fmt);
352
353 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
354 case SND_SOC_DAIFMT_NB_NF:
355 break;
356 case SND_SOC_DAIFMT_NB_IF:
357 fsync_pol = MAX98396_PCM_MODE_CFG_PCM_LRCLKEDGE;
358 break;
359 case SND_SOC_DAIFMT_IB_NF:
360 bclk_pol = MAX98396_PCM_MODE_CFG_PCM_BCLKEDGE;
361 break;
362 case SND_SOC_DAIFMT_IB_IF:
363 bclk_pol = MAX98396_PCM_MODE_CFG_PCM_BCLKEDGE;
364 fsync_pol = MAX98396_PCM_MODE_CFG_PCM_LRCLKEDGE;
365 break;
366
367 default:
368 dev_err(component->dev, "DAI invert mode unsupported\n");
369 return -EINVAL;
370 }
371
372 regmap_update_bits(max98396->regmap,
373 MAX98396_R2041_PCM_MODE_CFG,
374 MAX98396_PCM_MODE_CFG_PCM_LRCLKEDGE,
375 fsync_pol);
376
377 regmap_update_bits(max98396->regmap,
378 MAX98396_R2042_PCM_CLK_SETUP,
379 MAX98396_PCM_MODE_CFG_PCM_BCLKEDGE,
380 bclk_pol);
381
382 /* interface format */
383 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
384 case SND_SOC_DAIFMT_I2S:
385 format = MAX98396_PCM_FORMAT_I2S;
386 break;
387 case SND_SOC_DAIFMT_LEFT_J:
388 format = MAX98396_PCM_FORMAT_LJ;
389 break;
390 case SND_SOC_DAIFMT_DSP_A:
391 format = MAX98396_PCM_FORMAT_TDM_MODE1;
392 break;
393 case SND_SOC_DAIFMT_DSP_B:
394 format = MAX98396_PCM_FORMAT_TDM_MODE0;
395 break;
396 default:
397 return -EINVAL;
398 }
399
400 ret = regmap_read(max98396->regmap, MAX98396_R210F_GLOBAL_EN, &status);
401 if (ret < 0)
402 return -EINVAL;
403
404 if (status) {
405 ret = regmap_read(max98396->regmap, MAX98396_R2041_PCM_MODE_CFG, ®);
406 if (ret < 0)
407 return -EINVAL;
> 408 if (format != (reg & MAX98396_PCM_MODE_CFG_FORMAT_MASK))
409 update = true;
410 /* GLOBAL_EN OFF prior to pcm mode change */
411 if (update)
412 max98396_global_enable_onoff(max98396->regmap, false);
413 }
414
415 regmap_update_bits(max98396->regmap,
416 MAX98396_R2041_PCM_MODE_CFG,
417 MAX98396_PCM_MODE_CFG_FORMAT_MASK,
418 format);
419
420 if (status && update)
421 max98396_global_enable_onoff(max98396->regmap, true);
422
423 return 0;
424 }
425
--
0-DAY CI Kernel Test Service
https://01.org/lkp
prev parent reply other threads:[~2022-04-22 7:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 23:02 [PATCH V2 1/2] ASoC: dt-bindings: max98396: add amplifier driver Ryan Lee
2022-04-21 23:02 ` [PATCH V2 2/2] ASoC: " Ryan Lee
2022-04-22 7:06 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202204221550.phNeKLyn-lkp@intel.com \
--to=lkp@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=cy_huang@richtek.com \
--cc=devicetree@vger.kernel.org \
--cc=drhodes@opensource.cirrus.com \
--cc=hdegoede@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lukas.bulwahn@gmail.com \
--cc=pbrobinson@gmail.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh+dt@kernel.org \
--cc=ryan.lee.analog@gmail.com \
--cc=ryans.lee@analog.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=stephan@gerhold.net \
--cc=tanureal@opensource.cirrus.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).