Re: [PATCH 4/7] ALSA: hda: hda_component: Introduce component parent structure

From: kernel test robot
Date: Fri May 31 2024 - 15:59:28 EST


Hi Simon,

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.10-rc1 next-20240531]
[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/Simon-Trimmer/ALSA-hda-cs35l56-Component-should-be-unbound-before-deconstruction/20240531-231828
base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
patch link: https://lore.kernel.org/r/20240531151409.80284-5-simont%40opensource.cirrus.com
patch subject: [PATCH 4/7] ALSA: hda: hda_component: Introduce component parent structure
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240601/202406010354.ludmQT3O-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240601/202406010354.ludmQT3O-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406010354.ludmQT3O-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> sound/pci/hda/hda_component.c:140:27: warning: 'memset' call operates on objects of type 'struct hda_component_parent' while the size is based on a different type 'struct hda_component_parent *' [-Wsizeof-pointer-memaccess]
memset(parent, 0, sizeof(parent));
~~~~~~ ^~~~~~
sound/pci/hda/hda_component.c:140:27: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset(parent, 0, sizeof(parent));
^~~~~~
1 warning generated.


vim +140 sound/pci/hda/hda_component.c

133
134 int hda_component_manager_bind(struct hda_codec *cdc,
135 struct hda_component_parent *parent)
136 {
137 int i;
138
139 /* Init shared and component specific data */
> 140 memset(parent, 0, sizeof(parent));
141 for (i = 0; i < ARRAY_SIZE(parent->comps); i++)
142 parent->comps[i].codec = cdc;
143
144 return component_bind_all(hda_codec_dev(cdc), &parent->comps);
145 }
146 EXPORT_SYMBOL_NS_GPL(hda_component_manager_bind, SND_HDA_SCODEC_COMPONENT);
147

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