From: Joerg Roedel <jroedel@suse.de>
Date: Thu, 21 Apr 2016 18:21:31 +0200
Subject: iommu/amd: Don't use IS_ERR_VALUE to check integer values
Git-commit: 9ee35e4c6f42e792974872ee1ec4115718ce05bc
Patch-mainline: v4.7-rc1
References: bsc#975772

Use the better 'var < 0' check.

Fixes: 7aba6cb9ee9d ('iommu/amd: Make call-sites of get_device_id aware of its return value')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -375,7 +375,7 @@ static void init_unity_mappings_for_devi
 	int devid;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return;
 
 	list_for_each_entry(e, &amd_iommu_unity_map, list) {
@@ -397,7 +397,7 @@ static bool check_device(struct device *
 		return false;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return false;
 
 	/* Out of our scope? */
@@ -440,7 +440,7 @@ static int iommu_init_device(struct devi
 		return 0;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return devid;
 
 	dev_data = find_dev_data(devid);
@@ -470,7 +470,7 @@ static void iommu_ignore_device(struct d
 	int devid;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return;
 
 	alias = get_alias(dev);
@@ -488,7 +488,7 @@ static void iommu_uninit_device(struct d
 	struct iommu_dev_data *dev_data;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return;
 
 	dev_data = search_dev_data(devid);
@@ -2330,7 +2330,7 @@ static int amd_iommu_add_device(struct d
 		return 0;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return devid;
 
 	iommu = amd_iommu_rlookup_table[devid];
@@ -2376,7 +2376,7 @@ static void amd_iommu_remove_device(stru
 		return;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return;
 
 	iommu = amd_iommu_rlookup_table[devid];
@@ -3118,7 +3118,7 @@ static void amd_iommu_detach_device(stru
 		return;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return;
 
 	if (dev_data->domain != NULL)
@@ -3240,7 +3240,7 @@ static void amd_iommu_get_dm_regions(str
 	int devid;
 
 	devid = get_device_id(dev);
-	if (IS_ERR_VALUE(devid))
+	if (devid < 0)
 		return;
 
 	list_for_each_entry(entry, &amd_iommu_unity_map, list) {
@@ -3943,7 +3943,7 @@ static struct irq_domain *get_irq_domain
 	case X86_IRQ_ALLOC_TYPE_MSI:
 	case X86_IRQ_ALLOC_TYPE_MSIX:
 		devid = get_device_id(&info->msi_dev->dev);
-		if (IS_ERR_VALUE(devid))
+		if (devid < 0)
 			return NULL;
 
 		if (devid >= 0) {
