]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: ump: Shut up truncated string warning
authorTakashi Iwai <tiwai@suse.de>
Sat, 30 Nov 2024 09:00:08 +0000 (10:00 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 30 Nov 2024 09:02:44 +0000 (10:02 +0100)
The recent change for the legacy substream name update brought a
compile warning for some compilers due to the nature of snprintf().
Use scnprintf() to shut up the warning since the truncation is
intentional.

Fixes: e29e504e7890 ("ALSA: ump: Indicate the inactive group in legacy substream names")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411300103.FrGuTAYp-lkp@intel.com/
Link: https://patch.msgid.link/20241130090009.19849-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/ump.c

index d2b810eb84bcb814c34d3a049bb5b7cb57ad86cf..fe4d39ae1159304cfaa221bf280a8634a119d6ac 100644 (file)
@@ -1262,9 +1262,9 @@ static void fill_substream_names(struct snd_ump_endpoint *ump,
                name = ump->groups[idx].name;
                if (!*name)
                        name = ump->info.name;
-               snprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s",
-                        idx + 1, name,
-                        ump->groups[idx].active ? "" : " [Inactive]");
+               scnprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s",
+                         idx + 1, name,
+                         ump->groups[idx].active ? "" : " [Inactive]");
        }
 }