[PATCH][next] ALSA: aloop: make read-only array texts static const

Colin Ian King posted 1 patch 1 week, 4 days ago
sound/drivers/aloop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH][next] ALSA: aloop: make read-only array texts static const
Posted by Colin Ian King 1 week, 4 days ago
Don't populate the read-only const array texts on the stack at run time,
instead make it static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 sound/drivers/aloop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 236f49a7fb8b..7ebe8e5c9303 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -1668,7 +1668,7 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol,
 static int loopback_access_info(struct snd_kcontrol *kcontrol,
 				struct snd_ctl_elem_info *uinfo)
 {
-	const char * const texts[] = {"Interleaved", "Non-interleaved"};
+	static const char * const texts[] = {"Interleaved", "Non-interleaved"};
 
 	return snd_ctl_enum_info(uinfo, 1, ARRAY_SIZE(texts), texts);
 }
-- 
2.53.0
Re: [PATCH][next] ALSA: aloop: make read-only array texts static const
Posted by Takashi Iwai 1 week, 3 days ago
On Tue, 14 Jul 2026 18:33:16 +0200,
Colin Ian King wrote:
> 
> Don't populate the read-only const array texts on the stack at run time,
> instead make it static.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied now.  Thanks.


Takashi