iommu/amd: Remove an unneeded condition
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Jan 2016 09:36:06 +0000 (12:36 +0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 7 Jan 2016 12:08:07 +0000 (13:08 +0100)
get_device_id() returns an unsigned short device id.  It never fails and
it never returns a negative so we can remove this condition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c

index 6f6502d9fd6739f2d048fe553beb1d30ec4d66d9..539b0dea8034b5d5b61e93f5927b353448197c67 100644 (file)
@@ -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;