The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: sound/core/control.c:1317:50: sparse: sparse: restricted snd_ctl_elem_iface_t degrades to integer
Date: Fri, 08 May 2026 05:14:12 +0800	[thread overview]
Message-ID: <202605080539.maGqNAAY-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ab992f815d6736b5c7a6f5fd7bfe7bc106bb3dc
commit: 0542972950ef26670a5696e43c0ea2b7b6ac96d4 Merge branch 'for-linus' into for-next
date:   5 weeks ago
config: x86_64-randconfig-r134-20260507 (https://download.01.org/0day-ci/archive/20260508/202605080539.maGqNAAY-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260508/202605080539.maGqNAAY-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
| Fixes: 0542972950ef ("Merge branch 'for-linus' into for-next")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605080539.maGqNAAY-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   sound/core/control.c:396:11: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long h @@     got restricted snd_ctl_elem_iface_t const [usertype] iface @@
   sound/core/control.c:396:11: sparse:     expected unsigned long h
   sound/core/control.c:396:11: sparse:     got restricted snd_ctl_elem_iface_t const [usertype] iface
   sound/core/control.c:959:17: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c:959:26: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c:960:17: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c:960:26: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c:979:48: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c:1007:41: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c:1118:34: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
>> sound/core/control.c:1317:50: sparse: sparse: restricted snd_ctl_elem_iface_t degrades to integer
   sound/core/control.c:1745:40: sparse: sparse: restricted snd_ctl_elem_type_t degrades to integer
   sound/core/control.c: note: in included file:
   sound/core/control_compat.c:186:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected int [assigned] err @@     got restricted snd_ctl_elem_type_t [usertype] type @@
   sound/core/control_compat.c:186:21: sparse:     expected int [assigned] err
   sound/core/control_compat.c:186:21: sparse:     got restricted snd_ctl_elem_type_t [usertype] type

vim +1317 sound/core/control.c

84446536f63d47 Cezary Rojewski 2026-02-24  1285  
84446536f63d47 Cezary Rojewski 2026-02-24  1286  static int snd_ctl_put_verify(struct snd_card *card, struct snd_kcontrol *kctl,
84446536f63d47 Cezary Rojewski 2026-02-24  1287  			      struct snd_ctl_elem_value *control)
84446536f63d47 Cezary Rojewski 2026-02-24  1288  {
84446536f63d47 Cezary Rojewski 2026-02-24  1289  	struct snd_ctl_elem_value *original = card->value_buf;
84446536f63d47 Cezary Rojewski 2026-02-24  1290  	struct snd_ctl_elem_info info;
84446536f63d47 Cezary Rojewski 2026-02-24  1291  	const char *iname;
84446536f63d47 Cezary Rojewski 2026-02-24  1292  	int ret, retcmp;
84446536f63d47 Cezary Rojewski 2026-02-24  1293  
84446536f63d47 Cezary Rojewski 2026-02-24  1294  	memset(original, 0, sizeof(*original));
84446536f63d47 Cezary Rojewski 2026-02-24  1295  	memset(&info, 0, sizeof(info));
84446536f63d47 Cezary Rojewski 2026-02-24  1296  
84446536f63d47 Cezary Rojewski 2026-02-24  1297  	ret = kctl->info(kctl, &info);
84446536f63d47 Cezary Rojewski 2026-02-24  1298  	if (ret)
84446536f63d47 Cezary Rojewski 2026-02-24  1299  		return ret;
84446536f63d47 Cezary Rojewski 2026-02-24  1300  
84446536f63d47 Cezary Rojewski 2026-02-24  1301  	ret = kctl->get(kctl, original);
84446536f63d47 Cezary Rojewski 2026-02-24  1302  	if (ret)
84446536f63d47 Cezary Rojewski 2026-02-24  1303  		return ret;
84446536f63d47 Cezary Rojewski 2026-02-24  1304  
84446536f63d47 Cezary Rojewski 2026-02-24  1305  	ret = kctl->put(kctl, control);
84446536f63d47 Cezary Rojewski 2026-02-24  1306  	if (ret < 0)
84446536f63d47 Cezary Rojewski 2026-02-24  1307  		return ret;
84446536f63d47 Cezary Rojewski 2026-02-24  1308  
84446536f63d47 Cezary Rojewski 2026-02-24  1309  	/* Sanitize the new value (control->value) before comparing. */
84446536f63d47 Cezary Rojewski 2026-02-24  1310  	fill_remaining_elem_value(control, &info, 0);
84446536f63d47 Cezary Rojewski 2026-02-24  1311  
84446536f63d47 Cezary Rojewski 2026-02-24  1312  	/* With known state for both new and original, do the comparison. */
84446536f63d47 Cezary Rojewski 2026-02-24  1313  	retcmp = memcmp(&original->value, &control->value, sizeof(original->value));
84446536f63d47 Cezary Rojewski 2026-02-24  1314  	if (retcmp)
84446536f63d47 Cezary Rojewski 2026-02-24  1315  		retcmp = 1;
84446536f63d47 Cezary Rojewski 2026-02-24  1316  
84446536f63d47 Cezary Rojewski 2026-02-24 @1317  	iname = snd_ctl_elem_iface_names[kctl->id.iface];
84446536f63d47 Cezary Rojewski 2026-02-24  1318  	trace_snd_ctl_put(&kctl->id, iname, card->number, ret, retcmp);
84446536f63d47 Cezary Rojewski 2026-02-24  1319  
84446536f63d47 Cezary Rojewski 2026-02-24  1320  	return ret;
84446536f63d47 Cezary Rojewski 2026-02-24  1321  }
84446536f63d47 Cezary Rojewski 2026-02-24  1322  

:::::: The code at line 1317 was first introduced by commit
:::::: 84446536f63d471ab16b2faa25eeab1df21ace0a ALSA: control: Verify put() result when in debug mode

:::::: TO: Cezary Rojewski <cezary.rojewski@intel.com>
:::::: CC: Takashi Iwai <tiwai@suse.de>

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

                 reply	other threads:[~2026-05-07 21:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202605080539.maGqNAAY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tiwai@suse.de \
    /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