Skip to contentSkip to conversation

ALSA: hda: acpi: Make driver's match data const static

PATCH In review Takashi Iwai 2 participants 2 messages May 22, 2025 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: acpi: Make driver's match data const static

The driver's match data, nvidia_hda_data, is referred only locally, and should be static. Also, as it's a read-only data, it can be gracefully const, too.

Fixes 4b214c9bbe26 ("ALSA: hda - Add new driver for HDA controllers listed via ACPI")
---
 sound/pci/hda/hda_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_acpi.c +1 -1
index 513f8fde198b..505cc97e0ee9 100644
@@ -296,7 +296,7 @@ static const struct dev_pm_ops hda_acpi_pm = {
 	SYSTEM_SLEEP_PM_OPS(hda_acpi_suspend, hda_acpi_resume)
 };
 
-struct hda_data nvidia_hda_data = {
+static const struct hda_data nvidia_hda_data = {
 	.short_name = "NVIDIA",
 	.long_name = "NVIDIA HDA Controller",
 	.flags = AZX_DCAPS_CORBRP_SELF_CLEAR,
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Takashi Iwai

The driver's match data, nvidia_hda_data, is referred only locally, and should be static. Also, as it's a read-only data, it can be gracefully const, too.

Fixes 4b214c9bbe26 ("ALSA: hda - Add new driver for HDA controllers listed via ACPI")
---
 sound/pci/hda/hda_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_acpi.c +1 -1
index 513f8fde198b..505cc97e0ee9 100644
@@ -296,7 +296,7 @@ static const struct dev_pm_ops hda_acpi_pm = {
 	SYSTEM_SLEEP_PM_OPS(hda_acpi_suspend, hda_acpi_resume)
 };
 
-struct hda_data nvidia_hda_data = {
+static const struct hda_data nvidia_hda_data = {
 	.short_name = "NVIDIA",
 	.long_name = "NVIDIA HDA Controller",
 	.flags = AZX_DCAPS_CORBRP_SELF_CLEAR,
Signature · 1 line
2.49.0