Skip to contentSkip to conversation

iommu/amd: remove an unneeded condition

PATCH Applied Dan Carpenter 2 participants 2 messages Jan 7, 2016

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

PATCH 1/1 iommu/amd: remove an unneeded condition

get_device_id() returns an unsigned short device id. It never fails and it never returns a negative so we can remove this condition.

drivers/iommu/amd_iommu.c +3 -5
index 6f6502d..539b0de 100644
@@ -3857,11 +3857,9 @@ static struct irq_domain *get_irq_domain(struct irq_alloc_info *info)
 	case X86_IRQ_ALLOC_TYPE_MSI:
 	case X86_IRQ_ALLOC_TYPE_MSIX:
 		devid = get_device_id(&info->msi_dev->dev);
-		if (devid >= 0) {
-			iommu = amd_iommu_rlookup_table[devid];
-			if (iommu)
-				return iommu->msi_domain;
-		}
+		iommu = amd_iommu_rlookup_table[devid];
+		if (iommu)
+			return iommu->msi_domain;
 		break;
 	default:
 		break;
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

get_device_id() returns an unsigned short device id. It never fails and it never returns a negative so we can remove this condition.

Applied, thanks.