Skip to contentSkip to conversation

sound/soc/sdca/sdca_hid.c:27:15: sparse: sparse: incorrect type in assignment (different base types)

PATCH kernel test robot 1 participant 1 message Jul 22, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   97987520025658f30bb787a99ffbd9bbff9ffc9d
commit: ac558015dfd803626622bd0ba9645d58a3ed16b1 [3351/11398] ASoC: SDCA: add a HID device for HIDE entity
config: i386-randconfig-061-20250722 (https://download.01.org/0day-ci/archive/20250722/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250722/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> sound/soc/sdca/sdca_hid.c:27:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int rsize @@     got restricted __le16 [usertype] wDescriptorLength @@

sound/soc/sdca/sdca_hid.c:27:15: sparse: expected unsigned int rsize
sound/soc/sdca/sdca_hid.c:27:15: sparse: got restricted __le16 [usertype] wDescriptorLength

vim +27 sound/soc/sdca/sdca_hid.c

    20	
    21	static int sdwhid_parse(struct hid_device *hid)
    22	{
    23		struct sdca_entity *entity = hid->driver_data;
    24		unsigned int rsize;
    25		int ret;
    26	
  > 27		rsize = entity->hide.hid_desc.rpt_desc.wDescriptorLength;
    28	
    29		if (!rsize || rsize > HID_MAX_DESCRIPTOR_SIZE) {
    30			dev_err(&hid->dev, "invalid size of report descriptor (%u)\n", rsize);
    31			return -EINVAL;
    32		}
    33	
    34		ret = hid_parse_report(hid, entity->hide.hid_report_desc, rsize);
    35	
    36		if (!ret)
    37			return 0;
    38	
    39		dev_err(&hid->dev, "parsing report descriptor failed\n");
    40		return ret;
    41	}
    42	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki