From: kernel test robot <lkp@intel.com>
To: Wesley Cheng <quic_wcheng@quicinc.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-usb@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [usb:usb-testing 51/52] sound/usb/qcom/mixer_usb_offload.c:131:3: warning: 'sprintf' will always overflow; destination buffer has size 34, but format string expands to at least 38
Date: Sat, 15 Feb 2025 01:55:18 +0800 [thread overview]
Message-ID: <202502150149.mKpbIR83-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head: c26f6731b8da887f1fb92d4654da57a19a266466
commit: b8a7c987d82f97c4a9929a395923e5a2242cdaf5 [51/52] ALSA: usb-audio: qcom: Add USB offload route kcontrol
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250215/202502150149.mKpbIR83-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250215/202502150149.mKpbIR83-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/202502150149.mKpbIR83-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from sound/usb/qcom/mixer_usb_offload.c:6:
In file included from include/linux/usb.h:19:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/s390/include/asm/elf.h:181:
In file included from arch/s390/include/asm/mmu_context.h:11:
In file included from arch/s390/include/asm/pgalloc.h:18:
In file included from include/linux/mm.h:2224:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> sound/usb/qcom/mixer_usb_offload.c:131:3: warning: 'sprintf' will always overflow; destination buffer has size 34, but format string expands to at least 38 [-Wformat-overflow]
131 | sprintf(ctl_name, "USB Offload Playback Card Route PCM#%d",
| ^
sound/usb/qcom/mixer_usb_offload.c:147:3: warning: 'sprintf' will always overflow; destination buffer has size 34, but format string expands to at least 37 [-Wformat-overflow]
147 | sprintf(ctl_name, "USB Offload Playback PCM Route PCM#%d",
| ^
5 warnings generated.
vim +/sprintf +131 sound/usb/qcom/mixer_usb_offload.c
100
101 /**
102 * snd_usb_offload_create_ctl() - Add USB offload bounded mixer
103 * @chip: USB SND chip device
104 *
105 * Creates a sound control for a USB audio device, so that applications can
106 * query for if there is an available USB audio offload path, and which
107 * card is managing it.
108 */
109 int snd_usb_offload_create_ctl(struct snd_usb_audio *chip)
110 {
111 struct usb_device *udev = chip->dev;
112 struct snd_kcontrol_new *chip_kctl;
113 struct snd_usb_substream *subs;
114 struct snd_usb_stream *as;
115 char ctl_name[34];
116 int ret;
117
118 list_for_each_entry(as, &chip->pcm_list, list) {
119 subs = &as->substream[SNDRV_PCM_STREAM_PLAYBACK];
120 if (!subs->ep_num || as->pcm_index > 0xff)
121 continue;
122
123 chip_kctl = &snd_usb_offload_mapped_card_ctl;
124 chip_kctl->count = 1;
125 /*
126 * Store the associated USB SND card number and PCM index for
127 * the kctl.
128 */
129 chip_kctl->private_value = as->pcm_index |
130 chip->card->number << 16;
> 131 sprintf(ctl_name, "USB Offload Playback Card Route PCM#%d",
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-02-14 17:55 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=202502150149.mKpbIR83-lkp@intel.com \
--to=lkp@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=quic_wcheng@quicinc.com \
/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.