All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: sound/hda/codecs/hdmi/hdmi.c:378 hdmi_eld_ctl_get() warn: calling memset(x, y, ARRAY_SIZE());
Date: Tue, 24 Mar 2026 20:53:16 +0800	[thread overview]
Message-ID: <202603242001.1cmDCawX-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Takashi Iwai <tiwai@suse.de>
CC: Richard Fitzgerald <rf@opensource.cirrus.com>

Hi Takashi,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c369299895a591d96745d6492d4888259b004a9e
commit: 6014e9021b28e634935c776c0271b5cbcabdc5d6 ALSA: hda: Move codec drivers into sound/hda/codecs directory
date:   9 months ago
:::::: branch date: 2 days ago
:::::: commit date: 9 months ago
config: s390-randconfig-r071-20260324 (https://download.01.org/0day-ci/archive/20260324/202603242001.1cmDCawX-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 054e11d1a17e5ba88bb1a8ef32fad3346e80b186)
smatch: v0.5.0-9004-gb810ac53

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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202603242001.1cmDCawX-lkp@intel.com/

New smatch warnings:
sound/hda/codecs/hdmi/hdmi.c:378 hdmi_eld_ctl_get() warn: calling memset(x, y, ARRAY_SIZE());

Old smatch warnings:
sound/hda/codecs/hdmi/hdmi.c:391 hdmi_eld_ctl_get() warn: calling memset(x, y, ARRAY_SIZE());

vim +378 sound/hda/codecs/hdmi/hdmi.c

14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  362  
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  363  static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol,
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  364  			struct snd_ctl_elem_value *ucontrol)
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  365  {
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  366  	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  367  	struct hdmi_spec *spec = codec->spec;
a4e9a38b40a0e2 sound/pci/hda/patch_hdmi.c Takashi Iwai         2013-10-17  368  	struct hdmi_spec_per_pin *per_pin;
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  369  	struct hdmi_eld *eld;
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  370  	int pcm_idx;
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  371  	int err = 0;
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  372  
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  373  	pcm_idx = kcontrol->private_value;
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  374  	mutex_lock(&spec->pcm_lock);
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  375  	per_pin = pcm_idx_to_pin(spec, pcm_idx);
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  376  	if (!per_pin) {
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  377  		/* no pin is bound to the pcm */
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23 @378  		memset(ucontrol->value.bytes.data, 0,
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  379  		       ARRAY_SIZE(ucontrol->value.bytes.data));
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  380  		goto unlock;
fb087eaaef7206 sound/pci/hda/patch_hdmi.c Libin Yang           2016-02-23  381  	}
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  382  
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  383  	eld = &per_pin->sink_eld;
360a8245680053 sound/pci/hda/patch_hdmi.c David Henningsson    2016-02-05  384  	if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data) ||
360a8245680053 sound/pci/hda/patch_hdmi.c David Henningsson    2016-02-05  385  	    eld->eld_size > ELD_MAX_SIZE) {
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  386  		snd_BUG();
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  387  		err = -EINVAL;
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  388  		goto unlock;
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  389  	}
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  390  
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  391  	memset(ucontrol->value.bytes.data, 0,
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  392  	       ARRAY_SIZE(ucontrol->value.bytes.data));
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  393  	if (eld->eld_valid)
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  394  		memcpy(ucontrol->value.bytes.data, eld->eld_buffer,
68e03de9850706 sound/pci/hda/patch_hdmi.c David Henningsson    2013-02-19  395  		       eld->eld_size);
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  396  
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  397   unlock:
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  398  	mutex_unlock(&spec->pcm_lock);
f69548ffafcc49 sound/pci/hda/patch_hdmi.c Takashi Iwai         2018-07-12  399  	return err;
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  400  }
14bc52b8feaae6 sound/pci/hda/patch_hdmi.c Pierre-Louis Bossart 2011-09-30  401  

:::::: The code at line 378 was first introduced by commit
:::::: fb087eaaef72061b2bb4e35b70ab43865f541cad ALSA: hda - hdmi eld control created based on pcm

:::::: TO: Libin Yang <libin.yang@linux.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-03-24 12:54 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=202603242001.1cmDCawX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.