projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
9830c38
)
ALSA: usb-audio: scarlett_gen2: Fix -Wformat-truncation warning
author
Takashi Iwai
<tiwai@suse.de>
Fri, 15 Sep 2023 08:27:52 +0000
(10:27 +0200)
committer
Takashi Iwai
<tiwai@suse.de>
Fri, 15 Sep 2023 11:21:30 +0000
(13:21 +0200)
The recent enablement of -Wformat-truncation leads to a false-positive
warning for mixer_scarlett_gen2.c.
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-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer_scarlett_gen2.c
patch
|
blob
|
history
diff --git
a/sound/usb/mixer_scarlett_gen2.c
b/sound/usb/mixer_scarlett_gen2.c
index 9d11bb08667e7a664017a5ec8530e5ff4ade91f9..5c6f50f38840a19b38b0afaa190f1d0a9aaf81b1 100644
(file)
--- a/
sound/usb/mixer_scarlett_gen2.c
+++ b/
sound/usb/mixer_scarlett_gen2.c
@@
-3218,8
+3218,8
@@
static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
int from = i * info->inputs_per_phantom + 1;
int to = (i + 1) * info->inputs_per_phantom;
- snprintf(s, sizeof(s), fmt2, from, to,
- "Phantom Power", "Switch");
+ s
c
nprintf(s, sizeof(s), fmt2, from, to,
+
"Phantom Power", "Switch");
err = scarlett2_add_new_ctl(
mixer, &scarlett2_phantom_ctl,
i, 1, s, &private->phantom_ctls[i]);