summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-11-30 10:00:08 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-02 10:34:25 +0100
commitf59b81fe8df97f6de66a084c8e795f21fa69b8f8 (patch)
treeea47f86f2e4b307c1e9ffadaca2a7d7255689fa5
parentf5c5661f02b5539d88aea8497f8d0835d165e945 (diff)
ALSA: ump: Shut up truncated string warning
commit ed990c07af70d286f5736021c6e25d8df6f2f7b0 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/core/ump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/core/ump.c b/sound/core/ump.c
index 24f7d65ce49c..bd26bb2210cb 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -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]");
}
}