Skip to contentSkip to conversation

iommu/vt-d: silence an uninitialized variable warning

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 6, 2016 – Apr 7, 2016

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

PATCH 1/1 iommu/vt-d: silence an uninitialized variable warning

My static checker complains that "dma_alias" is uninitialized unless we are dealing with a pci device. This is true but harmless. Anyway, we can flip the condition around to silence the warning.

drivers/iommu/intel-iommu.c +1 -1
index a2e1b7f..e1852e8 100644
@@ -2458,7 +2458,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
 	}
 
 	/* register PCI DMA alias device */
-	if (req_id != dma_alias && dev_is_pci(dev)) {
+	if (dev_is_pci(dev) && req_id != dma_alias) {
 		tmp = dmar_insert_one_dev_info(iommu, PCI_BUS_NUM(dma_alias),
 					       dma_alias & 0xff, NULL, domain);
 
maintainer Applied
#1 lore raw
Quoted 5 lines · Dan Carpenter

My static checker complains that "dma_alias" is uninitialized unless we are dealing with a pci device. This is true but harmless. Anyway, we can flip the condition around to silence the warning.

Applied, thanks.