Skip to contentSkip to conversation

ALSA: oxfw: make read-only const array models static

PATCH Applied Colin Ian King 3 participants 3 messages Jun 27, 2023 – Jun 28, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: oxfw: make read-only const array models static

Don't populate the const array on the stack, instead make it static.

---
 sound/firewire/oxfw/oxfw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/firewire/oxfw/oxfw.c +1 -1
index 9523479fa94a..63d40f1a914f 100644
@@ -44,7 +44,7 @@ struct compat_info {
 
 static bool detect_loud_models(struct fw_unit *unit)
 {
-	const char *const models[] = {
+	static const char *const models[] = {
 		"Onyxi",
 		"Onyx-i",
 		"Onyx 1640i",
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 22 lines · Colin Ian King

Don't populate the const array on the stack, instead make it static.

---
 sound/firewire/oxfw/oxfw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/firewire/oxfw/oxfw.c +1 -1
index 9523479fa94a..63d40f1a914f 100644
@@ -44,7 +44,7 @@ struct compat_info {
 
 static bool detect_loud_models(struct fw_unit *unit)
 {
-	const char *const models[] = {
+	static const char *const models[] = {
 		"Onyxi",
 		"Onyx-i",
 		"Onyx 1640i",
Signature · 1 line
2.39.2

Indeed. It is preferable.

I found that ALSA fireface driver includes the similar issue. I'll send a patch to fix it later.

Thanks

Takashi Sakamoto