mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shenghao Ding <13916275206@139.com>,
	broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz,
	pierre-louis.bossart@linux.intel.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	kevin-lu@ti.com, shenghao-ding@ti.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	x1077012@ti.com, peeyush@ti.com, navada@ti.com,
	Shenghao Ding <13916275206@139.com>
Subject: Re: [PATCH v5] ASoC: tas2781: Add tas2781 driver
Date: Wed, 22 Mar 2023 08:52:47 +0800	[thread overview]
Message-ID: <202303220800.Pz99eL6X-lkp@intel.com> (raw)
In-Reply-To: <20230321113130.25853-1-13916275206@139.com>

Hi Shenghao,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on linus/master v6.3-rc3 next-20230321]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenghao-Ding/ASoC-tas2781-Add-tas2781-driver/20230321-193259
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/20230321113130.25853-1-13916275206%40139.com
patch subject: [PATCH v5] ASoC: tas2781: Add tas2781 driver
config: arm-randconfig-r046-20230320 (https://download.01.org/0day-ci/archive/20230322/202303220800.Pz99eL6X-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
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/a29d62a28a9077c66a962c69116c4eeb61f876f9
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Shenghao-Ding/ASoC-tas2781-Add-tas2781-driver/20230321-193259
        git checkout a29d62a28a9077c66a962c69116c4eeb61f876f9
        # 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 olddefconfig
        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 where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303220800.Pz99eL6X-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/soc/codecs/tas2781-i2c.c:1608:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (i2c->dev.of_node)
               ^~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-i2c.c:1626:6: note: uninitialized use occurs here
           if (ret < 0 && tas_dev != NULL)
               ^~~
   sound/soc/codecs/tas2781-i2c.c:1608:2: note: remove the 'if' if its condition is always true
           if (i2c->dev.of_node)
           ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-i2c.c:1580:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.
--
>> sound/soc/codecs/tas2781-dsp.c:1239:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   if (page == TAS2781_YRAM5_PAGE) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:1269:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   sound/soc/codecs/tas2781-dsp.c:1239:3: note: remove the 'if' if its condition is always true
                   if (page == TAS2781_YRAM5_PAGE) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:1210:14: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   } else if (page == TAS2781_YRAM3_PAGE) {
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:1269:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   sound/soc/codecs/tas2781-dsp.c:1210:10: note: remove the 'if' if its condition is always true
                   } else if (page == TAS2781_YRAM3_PAGE) {
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:1195:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
>> sound/soc/codecs/tas2781-dsp.c:2066:6: warning: variable 'prog_status' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (rca_conf_no > rca->ncfgs || rca_conf_no <= 0 ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2151:9: note: uninitialized use occurs here
           return prog_status;
                  ^~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2066:2: note: remove the 'if' if its condition is always false
           if (rca_conf_no > rca->ncfgs || rca_conf_no <= 0 ||
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/codecs/tas2781-dsp.c:2066:6: warning: variable 'prog_status' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
           if (rca_conf_no > rca->ncfgs || rca_conf_no <= 0 ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2151:9: note: uninitialized use occurs here
           return prog_status;
                  ^~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2066:6: note: remove the '||' if its condition is always false
           if (rca_conf_no > rca->ncfgs || rca_conf_no <= 0 ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/codecs/tas2781-dsp.c:2066:6: warning: variable 'prog_status' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
           if (rca_conf_no > rca->ncfgs || rca_conf_no <= 0 ||
               ^~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2151:9: note: uninitialized use occurs here
           return prog_status;
                  ^~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2066:6: note: remove the '||' if its condition is always false
           if (rca_conf_no > rca->ncfgs || rca_conf_no <= 0 ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2059:6: warning: variable 'prog_status' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (prm_no >= tas_fmw->nr_programs) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2151:9: note: uninitialized use occurs here
           return prog_status;
                  ^~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2059:2: note: remove the 'if' if its condition is always false
           if (prm_no >= tas_fmw->nr_programs) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2052:6: warning: variable 'prog_status' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (cfg_no >= tas_fmw->nr_configurations) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2151:9: note: uninitialized use occurs here
           return prog_status;
                  ^~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2052:2: note: remove the 'if' if its condition is always false
           if (cfg_no >= tas_fmw->nr_configurations) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2047:6: warning: variable 'prog_status' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!tas_fmw) {
               ^~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2151:9: note: uninitialized use occurs here
           return prog_status;
                  ^~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2047:2: note: remove the 'if' if its condition is always false
           if (!tas_fmw) {
           ^~~~~~~~~~~~~~~
   sound/soc/codecs/tas2781-dsp.c:2045:17: note: initialize the variable 'prog_status' to silence this warning
           int prog_status;
                          ^
                           = 0
   8 warnings generated.


vim +1608 sound/soc/codecs/tas2781-i2c.c

  1576	
  1577	static int tasdevice_i2c_probe(struct i2c_client *i2c)
  1578	{
  1579		struct tasdevice_priv *tas_dev = NULL;
  1580		int ret;
  1581		const struct acpi_device_id *acpi_id;
  1582		const struct i2c_device_id *id = i2c_match_id(tasdevice_id, i2c);
  1583	
  1584		tas_dev = devm_kzalloc(&i2c->dev, sizeof(*tas_dev), GFP_KERNEL);
  1585		if (!tas_dev) {
  1586			ret = -ENOMEM;
  1587			goto out;
  1588		}
  1589	
  1590		if (ACPI_HANDLE(&i2c->dev)) {
  1591			acpi_id = acpi_match_device(i2c->dev.driver->acpi_match_table,
  1592					&i2c->dev);
  1593			if (!acpi_id) {
  1594				dev_err(&i2c->dev, "No driver data\n");
  1595				ret = -EINVAL;
  1596				goto out;
  1597			}
  1598			tas_dev->chip_id = acpi_id->driver_data;
  1599			tas_dev->isacpi = true;
  1600		} else {
  1601			tas_dev->chip_id = (id != NULL) ? id->driver_data : 0;
  1602			tas_dev->isacpi = false;
  1603		}
  1604	
  1605		tas_dev->dev = &i2c->dev;
  1606		tas_dev->client = (void *)i2c;
  1607	
> 1608		if (i2c->dev.of_node)
  1609			ret = tasdevice_parse_dt(tas_dev);
  1610		else {
  1611			dev_err(tas_dev->dev, "No DTS info\n");
  1612			goto out;
  1613		}
  1614	
  1615		tas_dev->regmap = devm_regmap_init_i2c(i2c,
  1616			&tasdevice_regmap);
  1617		if (IS_ERR(tas_dev->regmap)) {
  1618			ret = PTR_ERR(tas_dev->regmap);
  1619			dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
  1620				ret);
  1621			goto out;
  1622		}
  1623		ret = tasdevice_init(tas_dev);
  1624	
  1625	out:
  1626		if (ret < 0 && tas_dev != NULL)
  1627			tasdevice_remove(tas_dev);
  1628		return ret;
  1629	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

      parent reply	other threads:[~2023-03-22  0:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 11:31 Shenghao Ding
2023-03-21 13:21 ` Pierre-Louis Bossart
2023-03-21 13:22 ` Mark Brown
2023-03-22  0:52 ` 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=202303220800.Pz99eL6X-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=13916275206@139.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=navada@ti.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peeyush@ti.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shenghao-ding@ti.com \
    --cc=x1077012@ti.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

all inboxes | Powered by JetHome®