lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202408312351.eV8p77QU-lkp@intel.com>
Date: Sat, 31 Aug 2024 23:40:39 +0800
From: kernel test robot <lkp@...el.com>
To: Leo Tsai <antivirus621@...il.com>, perex@...ex.cz, tiwai@...e.com
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	leo.tsai@...dia.com.tw, linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ALSA: hda: Add new CM9825 driver

Hi Leo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tiwai-sound/for-next]
[also build test WARNING on tiwai-sound/for-linus linus/master v6.11-rc5 next-20240830]
[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/Leo-Tsai/ALSA-hda-Add-new-CM9825-driver/20240830-164709
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
patch link:    https://lore.kernel.org/r/20240830084521.15706-1-antivirus621%40gmail.com
patch subject: [PATCH] ALSA: hda: Add new CM9825 driver
config: i386-buildonly-randconfig-002-20240831 (https://download.01.org/0day-ci/archive/20240831/202408312351.eV8p77QU-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240831/202408312351.eV8p77QU-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408312351.eV8p77QU-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/pci/hda/patch_cmedia.c:572:12: warning: variable 'spec' is uninitialized when used here [-Wuninitialized]
     572 |         codec_dbg(spec->codec, "Start\n");
         |                   ^~~~
   sound/pci/hda/hda_local.h:735:24: note: expanded from macro 'codec_dbg'
     735 |         dev_dbg(hda_codec_dev(codec), fmt, ##args)
         |                               ^~~~~
   include/sound/hda_codec.h:289:32: note: expanded from macro 'hda_codec_dev'
     289 | #define hda_codec_dev(_dev)     (&(_dev)->core.dev)
         |                                    ^~~~
   include/linux/dev_printk.h:165:18: note: expanded from macro 'dev_dbg'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                         ^~~
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
     250 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
     248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
     224 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   sound/pci/hda/patch_cmedia.c:567:23: note: initialize the variable 'spec' to silence this warning
     567 |         struct cmi_spec *spec;
         |                              ^
         |                               = NULL
   1 warning generated.


vim +/spec +572 sound/pci/hda/patch_cmedia.c

   564	
   565	static int patch_cm9825(struct hda_codec *codec)
   566	{
   567		struct cmi_spec *spec;
   568		struct auto_pin_cfg *cfg;
   569		int err, i;
   570		const struct snd_pci_quirk *quirk;
   571	
 > 572		codec_dbg(spec->codec, "Start\n");
   573	
   574		spec = kzalloc(sizeof(*spec), GFP_KERNEL);
   575		if (spec == NULL)
   576			return -ENOMEM;
   577	
   578		codec->spec = spec;
   579		spec->codec = codec;
   580	
   581		/* Detect codec quirk */
   582		quirk = snd_pci_quirk_lookup(codec->bus->pci, cm9825_quirks);
   583		if (quirk)
   584			spec->quirk = quirk->value;
   585		else
   586			spec->quirk = QUIRK_CM9825_STANDARD;
   587	
   588		if (spec->quirk == QUIRK_CM9825_STANDARD)
   589			cm9825_detect_quirk(codec);
   590	
   591		codec_dbg(spec->codec, "spec->quirk %d\n", spec->quirk);
   592	
   593		codec->patch_ops = cmi_auto_patch_ops;
   594		codec->patch_ops.init = CM9825_init;
   595	#ifdef CONFIG_PM
   596		codec->patch_ops.suspend = cm9825_suspend;
   597		codec->patch_ops.resume = cm9825_resume;
   598		codec->patch_ops.check_power_status = snd_hda_gen_check_power_status;
   599	#endif
   600		spec->gen.init_hook = CM9825_init_hook;
   601		/* add hooks */
   602		spec->gen.pcm_playback_hook = cm9825_playback_pcm_hook;
   603	
   604		cfg = &spec->gen.autocfg;
   605		snd_hda_gen_spec_init(&spec->gen);
   606	
   607		if (spec->quirk == (int)QUIRK_CM9825_STANDARD) {
   608			snd_hda_codec_set_name(codec, "CM9825 Standard");
   609			spec->chip_D0_verbs = cm9825_D0_verbs;
   610			spec->chip_D3_verbs = cm9825_D3_verbs;
   611			spec->chip_HP_Present_verbs = cm9825_HP_Present_verbs;
   612			spec->chip_HP_Remove_verbs = cm9825_HP_Remove_verbs;
   613			spec->chip_playback_start_verbs =
   614			    cm9825_std_playback_start_verbs;
   615			spec->chip_playback_stop_verbs = cm9825_std_playback_stop_verbs;
   616		} else if (spec->quirk == (int)QUIRK_CM9825_NCR) {
   617	#ifdef CONFIG_PM
   618			codec->patch_ops.suspend = cm9825_NCR_suspend;
   619			codec->patch_ops.resume = cm9825_NCR_resume;
   620			codec->patch_ops.check_power_status =
   621			    snd_hda_gen_check_power_status;
   622	#endif
   623			snd_hda_codec_set_name(codec, "CM9825 NCR");
   624			snd_hda_sequence_write(codec, cm9825_NCR_TpCon_verbs);
   625			spec->chip_D0_verbs = cm9825_NCR_D0_verbs;
   626			spec->chip_D3_verbs = cm9825_NCR_D3_verbs;
   627			spec->chip_playback_start_verbs =
   628			    cm9825_NCR_playback_start_verbs;
   629			spec->chip_playback_stop_verbs = cm9825_NCR_playback_stop_verbs;
   630	
   631			for (i = 0; i < ARRAY_SIZE(cm9825_ncr_mixer); i++) {
   632				err = snd_hda_add_new_ctls(codec, &cm9825_ncr_mixer[i]);
   633				if (err < 0) {
   634					codec_info(codec, "add new ctls fail: %d\n",
   635						   err);
   636					goto error;
   637				}
   638			}
   639		} else {
   640			snd_hda_codec_set_name(codec, "CM9825 Standard");
   641			spec->chip_D0_verbs = cm9825_D0_verbs;
   642			spec->chip_D3_verbs = cm9825_D3_verbs;
   643			spec->chip_HP_Present_verbs = cm9825_HP_Present_verbs;
   644			spec->chip_HP_Remove_verbs = cm9825_HP_Remove_verbs;
   645			spec->chip_playback_start_verbs =
   646			    cm9825_std_playback_start_verbs;
   647			spec->chip_playback_stop_verbs = cm9825_std_playback_stop_verbs;
   648		}
   649	
   650		err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
   651		if (err < 0)
   652			goto error;
   653		err = snd_hda_gen_parse_auto_config(codec, cfg);
   654		if (err < 0)
   655			goto error;
   656	
   657		if (spec->quirk == (int)QUIRK_CM9825_STANDARD) {
   658			INIT_DELAYED_WORK(&spec->unsol_hp_work,
   659					  cm9825_unsol_hp_delayed);
   660			cm9825_setup_unsol(codec);
   661		}
   662	
   663		return 0;
   664	
   665	 error:
   666		snd_hda_gen_free(codec);
   667	
   668		codec_info(codec, "Enter err %d\n", err);
   669	
   670		return err;
   671	}
   672	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ