Skip to contentSkip to conversation

ALSA: Corrects warning: missing braces around initializer

PATCH New [email protected] 1 participant 1 message Oct 30, 2020 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: Corrects warning: missing braces around initializer

From: John Donnelly <[email protected]>

The assignment statement of a local variable "struct hpi_pci pci = { 0 }; " is not valid for all versions of compiler.

Fixes 9c3c9d37ae1e ("ALSA: asihpi: fix iounmap in error handler")
---
 sound/pci/asihpi/hpioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/pci/asihpi/hpioctl.c +2 -1
index b4ccd9f92400..1cd7c197ab96 100644
@@ -350,8 +350,9 @@ int asihpi_adapter_probe(struct pci_dev *pci_dev,
 	struct hpi_message hm;
 	struct hpi_response hr;
 	struct hpi_adapter adapter;
-	struct hpi_pci pci = { 0 };
+	struct hpi_pci pci;
 
+	memset(&pci, 0, sizeof(pci));
 	memset(&adapter, 0, sizeof(adapter));
 
 	dev_printk(KERN_DEBUG, &pci_dev->dev,
Signature · 1 line
2.27.0