diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-09-15 10:27:58 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-09-15 13:21:35 +0200 |
commit | 7272b8bfba35b2333b33d77f73ce75ee161880c2 (patch) | |
tree | 85c7a096dfa4a1ffcb1be0447ace8af7a739ac6d /sound/xen | |
parent | bc44e10abb90ac65a7b5337cb3323ec1ce79fb9a (diff) | |
download | linux-7272b8bfba35b2333b33d77f73ce75ee161880c2.tar.gz linux-7272b8bfba35b2333b33d77f73ce75ee161880c2.tar.bz2 linux-7272b8bfba35b2333b33d77f73ce75ee161880c2.zip |
ALSA: xen: Fix -Wformat-truncation warning
The compile warning with -Wformat-truncation at
xen_snd_front_cfg_card() is false-positive; the loop can be only for
SNDRV_PCM_DEVICES which is at most 32.
For suppressing the warning, replace snprintf() with scnprintf().
As stated in the above, truncation doesn't matter.
Link: https://lore.kernel.org/r/20230915082802.28684-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/xen')
-rw-r--r-- | sound/xen/xen_snd_front_cfg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/xen/xen_snd_front_cfg.c b/sound/xen/xen_snd_front_cfg.c index 63b0398c3276..55ecf766ca67 100644 --- a/sound/xen/xen_snd_front_cfg.c +++ b/sound/xen/xen_snd_front_cfg.c @@ -483,7 +483,7 @@ int xen_snd_front_cfg_card(struct xen_snd_front_info *front_info, *stream_cnt = 0; num_devices = 0; do { - snprintf(node, sizeof(node), "%d", num_devices); + scnprintf(node, sizeof(node), "%d", num_devices); if (!xenbus_exists(XBT_NIL, xb_dev->nodename, node)) break; |