aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1633-drm-amdkfd-Fix-IS_ERR-references.patch
blob: 4e04ec20cb1a85644ec2aced4c846377dae984c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From 98a8122179b1bf832cd7d965e2071d53cd362d63 Mon Sep 17 00:00:00 2001
From: Kent Russell <kent.russell@amd.com>
Date: Tue, 28 Mar 2017 06:41:30 -0400
Subject: [PATCH 1633/4131] drm/amdkfd: Fix IS_ERR references

IS_ERR() returns boolean, not int, so adjust accordingly

Change-Id: Ia8fda3a86009314a60192fc038d989f433ce7b9d
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 16 ++++++++--------
 drivers/gpu/drm/amd/amdkfd/kfd_ipc.c     |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index b8e436c..68fa045 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -569,7 +569,7 @@ kfd_ioctl_dbg_register(struct file *filep, struct kfd_process *p, void *data)
 
 	/* make sure that we have pdd, if this the first queue created for this process */
 	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		mutex_unlock(get_dbgmgr_mutex());
 		up_write(&p->lock);
 		return PTR_ERR(pdd);
@@ -1054,7 +1054,7 @@ kfd_ioctl_create_event(struct file *filp, struct kfd_process *p, void *data)
 		if (KFD_IS_DGPU(kfd->device_info->asic_family)) {
 			down_write(&p->lock);
 			pdd = kfd_bind_process_to_device(kfd, p);
-			if (IS_ERR(pdd) < 0) {
+			if (IS_ERR(pdd)) {
 				err = PTR_ERR(pdd);
 				up_write(&p->lock);
 				return -EFAULT;
@@ -1147,7 +1147,7 @@ static int kfd_ioctl_alloc_scratch_memory(struct file *filep,
 	down_write(&p->lock);
 
 	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		err = PTR_ERR(pdd);
 		goto bind_process_to_device_fail;
 	}
@@ -1193,7 +1193,7 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep,
 	down_write(&p->lock);
 	pdd = kfd_bind_process_to_device(dev, p);
 	up_write(&p->lock);
-	if (IS_ERR(pdd) < 0)
+	if (IS_ERR(pdd))
 		return PTR_ERR(pdd);
 
 	err = dev->kfd2kgd->alloc_memory_of_gpu(
@@ -1326,7 +1326,7 @@ static int kfd_ioctl_alloc_memory_of_gpu_new(struct file *filep,
 	down_write(&p->lock);
 	pdd = kfd_bind_process_to_device(dev, p);
 	up_write(&p->lock);
-	if (IS_ERR(pdd) < 0)
+	if (IS_ERR(pdd))
 		return PTR_ERR(pdd);
 
 	if (args->flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL) {
@@ -1478,7 +1478,7 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep,
 	down_write(&p->lock);
 
 	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		err = PTR_ERR(pdd);
 		goto bind_process_to_device_failed;
 	}
@@ -1681,7 +1681,7 @@ static int kfd_ioctl_open_graphic_handle(struct file *filep,
 	down_write(&p->lock);
 	pdd = kfd_bind_process_to_device(dev, p);
 	up_write(&p->lock);
-	if (IS_ERR(pdd) < 0)
+	if (IS_ERR(pdd))
 		return PTR_ERR(pdd);
 
 	err = dev->kfd2kgd->open_graphic_handle(dev->kgd,
@@ -1728,7 +1728,7 @@ static int kfd_ioctl_set_process_dgpu_aperture(struct file *filep,
 	down_write(&p->lock);
 
 	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		err = PTR_ERR(pdd);
 		goto exit;
 	}
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_ipc.c b/drivers/gpu/drm/amd/amdkfd/kfd_ipc.c
index ba1e061..e119ce7 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_ipc.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_ipc.c
@@ -129,7 +129,7 @@ static int kfd_import_dmabuf_create_kfd_bo(struct kfd_dev *dev,
 	down_write(&p->lock);
 	pdd = kfd_bind_process_to_device(dev, p);
 	up_write(&p->lock);
-	if (IS_ERR(pdd) < 0)
+	if (IS_ERR(pdd))
 		return PTR_ERR(pdd);
 
 	r = dev->kfd2kgd->import_dmabuf(dev->kgd, dmabuf,
@@ -243,7 +243,7 @@ int kfd_ipc_export_as_handle(struct kfd_dev *dev, struct kfd_process *p,
 	pdd = kfd_bind_process_to_device(dev, p);
 	up_write(&p->lock);
 
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		pr_err("failed to get pdd\n");
 		return PTR_ERR(pdd);
 	}
-- 
2.7.4