Commit f45b59bd authored by Takashi Iwai's avatar Takashi Iwai Committed by Wen Zhiwei
Browse files

ALSA: ump: Shut up truncated string warning

stable inclusion
from stable-v6.6.70
commit d4eb5b3c115d5a95bd0b8d4a584a93941b882b4d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBOHV1

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d4eb5b3c115d5a95bd0b8d4a584a93941b882b4d



--------------------------------

[ Upstream commit ed990c07af70d286f5736021c6e25d8df6f2f7b0 ]

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: default avatarkernel 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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 21e8c97b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1251,7 +1251,7 @@ 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",
		scnprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s",
			  idx + 1, name,
			  ump->groups[idx].active ? "" : " [Inactive]");
	}