diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-09-15 11:28:00 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-09-15 14:22:06 +0300 |
commit | ea77850e98410987525eb392c229949c87779835 (patch) | |
tree | d4d06b63ab27b451bf1916c7424c2cd757282fb9 /sound/firewire/tascam/tascam-midi.c | |
parent | 641e969114c781ff269e1bf1b1f8d3cc33bc4a1a (diff) | |
download | linux-ea77850e98410987525eb392c229949c87779835.tar.xz |
ALSA: firewire: Fix -Wformat-truncation warning for MIDI stream names
The compile warnings at filling MIDI stream name strings are all
false-positive; the number of streams can't go so high.
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-12-tiwai@suse.de
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/tascam/tascam-midi.c')
-rw-r--r-- | sound/firewire/tascam/tascam-midi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/firewire/tascam/tascam-midi.c b/sound/firewire/tascam/tascam-midi.c index 02eed2dce435..c57fac4f1968 100644 --- a/sound/firewire/tascam/tascam-midi.c +++ b/sound/firewire/tascam/tascam-midi.c @@ -108,9 +108,9 @@ int snd_tscm_create_midi_devices(struct snd_tscm *tscm) /* TODO: support virtual MIDI ports. */ if (subs->number < tscm->spec->midi_capture_ports) { /* Hardware MIDI ports. */ - snprintf(subs->name, sizeof(subs->name), - "%s MIDI %d", - tscm->card->shortname, subs->number + 1); + scnprintf(subs->name, sizeof(subs->name), + "%s MIDI %d", + tscm->card->shortname, subs->number + 1); } } @@ -123,9 +123,9 @@ int snd_tscm_create_midi_devices(struct snd_tscm *tscm) list_for_each_entry(subs, &stream->substreams, list) { if (subs->number < tscm->spec->midi_playback_ports) { /* Hardware MIDI ports only. */ - snprintf(subs->name, sizeof(subs->name), - "%s MIDI %d", - tscm->card->shortname, subs->number + 1); + scnprintf(subs->name, sizeof(subs->name), + "%s MIDI %d", + tscm->card->shortname, subs->number + 1); } } |