ALSA: ump: Shut up truncated string warning

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: e29e504e78 ("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>
This commit is contained in:
Takashi Iwai 2024-11-30 10:00:08 +01:00
parent 9b5f8ee43e
commit ed990c07af

View File

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