* [tiwai-sound:for-next 12/13] sound/pci/hda/patch_ca0132.c:4413:27: warning: '%s' directive writing up to 767 bytes into a region of size 44
@ 2025-06-09 22:52 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-06-09 22:52 UTC (permalink / raw)
To: Lucy Thrun; +Cc: oe-kbuild-all, alsa-devel, Takashi Iwai
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
head: 92f59aeb13252265c20e7aef1379a8080c57e0a2
commit: ed57a3d5a3118b9681de607692608fe573c5959d [12/13] ALSA: hda/ca0132: Enable hardware band EQ for Sound Blaster Core3D
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20250610/202506100642.95jpuMY1-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250610/202506100642.95jpuMY1-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506100642.95jpuMY1-lkp@intel.com/
All warnings (new ones prefixed by >>):
sound/pci/hda/patch_ca0132.c: In function 'ca0132_build_controls':
>> sound/pci/hda/patch_ca0132.c:4413:27: warning: '%s' directive writing up to 767 bytes into a region of size 44 [-Wformat-overflow=]
4413 | sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
| ^~
In function 'add_tuning_control',
inlined from 'add_tuning_ctls' at sound/pci/hda/patch_ca0132.c:4423:9,
inlined from 'ca0132_build_controls' at sound/pci/hda/patch_ca0132.c:7195:2:
sound/pci/hda/patch_ca0132.c:4413:9: note: 'sprintf' output 9 or more bytes (assuming 776) into a destination of size 44
4413 | sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +4413 sound/pci/hda/patch_ca0132.c
44f0c9782cc6ab Ian Minett 2012-12-20 4376
44f0c9782cc6ab Ian Minett 2012-12-20 4377 static int add_tuning_control(struct hda_codec *codec,
44f0c9782cc6ab Ian Minett 2012-12-20 4378 hda_nid_t pnid, hda_nid_t nid,
44f0c9782cc6ab Ian Minett 2012-12-20 4379 const char *name, int dir)
44f0c9782cc6ab Ian Minett 2012-12-20 4380 {
975cc02a904ae3 Takashi Iwai 2013-06-28 4381 char namestr[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
44f0c9782cc6ab Ian Minett 2012-12-20 4382 int type = dir ? HDA_INPUT : HDA_OUTPUT;
44f0c9782cc6ab Ian Minett 2012-12-20 4383 struct snd_kcontrol_new knew =
44f0c9782cc6ab Ian Minett 2012-12-20 4384 HDA_CODEC_VOLUME_MONO(namestr, nid, 1, 0, type);
44f0c9782cc6ab Ian Minett 2012-12-20 4385
44f0c9782cc6ab Ian Minett 2012-12-20 4386 knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
44f0c9782cc6ab Ian Minett 2012-12-20 4387 SNDRV_CTL_ELEM_ACCESS_TLV_READ;
44f0c9782cc6ab Ian Minett 2012-12-20 4388 knew.tlv.c = 0;
44f0c9782cc6ab Ian Minett 2012-12-20 4389 knew.tlv.p = 0;
44f0c9782cc6ab Ian Minett 2012-12-20 4390 switch (pnid) {
44f0c9782cc6ab Ian Minett 2012-12-20 4391 case VOICE_FOCUS:
44f0c9782cc6ab Ian Minett 2012-12-20 4392 knew.info = voice_focus_ctl_info;
44f0c9782cc6ab Ian Minett 2012-12-20 4393 knew.get = tuning_ctl_get;
44f0c9782cc6ab Ian Minett 2012-12-20 4394 knew.put = voice_focus_ctl_put;
44f0c9782cc6ab Ian Minett 2012-12-20 4395 knew.tlv.p = voice_focus_db_scale;
44f0c9782cc6ab Ian Minett 2012-12-20 4396 break;
44f0c9782cc6ab Ian Minett 2012-12-20 4397 case MIC_SVM:
44f0c9782cc6ab Ian Minett 2012-12-20 4398 knew.info = mic_svm_ctl_info;
44f0c9782cc6ab Ian Minett 2012-12-20 4399 knew.get = tuning_ctl_get;
44f0c9782cc6ab Ian Minett 2012-12-20 4400 knew.put = mic_svm_ctl_put;
44f0c9782cc6ab Ian Minett 2012-12-20 4401 break;
44f0c9782cc6ab Ian Minett 2012-12-20 4402 case EQUALIZER:
44f0c9782cc6ab Ian Minett 2012-12-20 4403 knew.info = equalizer_ctl_info;
44f0c9782cc6ab Ian Minett 2012-12-20 4404 knew.get = tuning_ctl_get;
44f0c9782cc6ab Ian Minett 2012-12-20 4405 knew.put = equalizer_ctl_put;
44f0c9782cc6ab Ian Minett 2012-12-20 4406 knew.tlv.p = eq_db_scale;
44f0c9782cc6ab Ian Minett 2012-12-20 4407 break;
44f0c9782cc6ab Ian Minett 2012-12-20 4408 default:
44f0c9782cc6ab Ian Minett 2012-12-20 4409 return 0;
44f0c9782cc6ab Ian Minett 2012-12-20 4410 }
44f0c9782cc6ab Ian Minett 2012-12-20 4411 knew.private_value =
44f0c9782cc6ab Ian Minett 2012-12-20 4412 HDA_COMPOSE_AMP_VAL(nid, 1, 0, type);
44f0c9782cc6ab Ian Minett 2012-12-20 @4413 sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
44f0c9782cc6ab Ian Minett 2012-12-20 4414 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
44f0c9782cc6ab Ian Minett 2012-12-20 4415 }
44f0c9782cc6ab Ian Minett 2012-12-20 4416
:::::: The code at line 4413 was first introduced by commit
:::::: 44f0c9782cc6ab71ea947f8f710a46f2078a151c ALSA: hda/ca0132: Add tuning controls
:::::: TO: Ian Minett <ian_minett@creativelabs.com>
:::::: CC: Takashi Iwai <tiwai@suse.de>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-09 22:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-09 22:52 [tiwai-sound:for-next 12/13] sound/pci/hda/patch_ca0132.c:4413:27: warning: '%s' directive writing up to 767 bytes into a region of size 44 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).