[alsa-devel] [asoc:topic/amd 1/1] sound/soc/amd/acp-da7219-max98357a.c:325:3: warning: 'ret' may be used uninitialized in this function

kbuild test robot lkp at intel.com
Wed Jul 25 20:04:00 CEST 2018


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git topic/amd
head:   7b5317aa809f833d017196ad4a34e3b3b7dae101
commit: 7b5317aa809f833d017196ad4a34e3b3b7dae101 [1/1] ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002
config: x86_64-randconfig-x002-201829 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout 7b5317aa809f833d017196ad4a34e3b3b7dae101
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_probe':
>> sound/soc/amd/acp-da7219-max98357a.c:325:3: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
      dev_err(&pdev->dev, "Failed to register regulator: %d\n",
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       ret);
       ~~~~

vim +/ret +325 sound/soc/amd/acp-da7219-max98357a.c

   313	
   314	static int cz_probe(struct platform_device *pdev)
   315	{
   316		int ret;
   317		struct snd_soc_card *card;
   318		struct acp_platform_info *machine;
   319		struct regulator_dev *rdev;
   320	
   321		acp_da7219_cfg.dev = &pdev->dev;
   322		rdev = devm_regulator_register(&pdev->dev, &acp_da7219_desc,
   323					       &acp_da7219_cfg);
   324		if (IS_ERR(rdev)) {
 > 325			dev_err(&pdev->dev, "Failed to register regulator: %d\n",
   326				ret);
   327			return -EINVAL;
   328		}
   329	
   330		machine = devm_kzalloc(&pdev->dev, sizeof(struct acp_platform_info),
   331				       GFP_KERNEL);
   332		if (!machine)
   333			return -ENOMEM;
   334		card = &cz_card;
   335		cz_card.dev = &pdev->dev;
   336		platform_set_drvdata(pdev, card);
   337		snd_soc_card_set_drvdata(card, machine);
   338		ret = devm_snd_soc_register_card(&pdev->dev, &cz_card);
   339		if (ret) {
   340			dev_err(&pdev->dev,
   341					"devm_snd_soc_register_card(%s) failed: %d\n",
   342					cz_card.name, ret);
   343			return ret;
   344		}
   345		bt_uart_enable = !device_property_read_bool(&pdev->dev,
   346							    "bt-pad-enable");
   347		return 0;
   348	}
   349	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36729 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180726/c6b74b27/attachment-0001.bin>


More information about the Alsa-devel mailing list