aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2119-drm-amdkfd-Fix-compiler-warning.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2119-drm-amdkfd-Fix-compiler-warning.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2119-drm-amdkfd-Fix-compiler-warning.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2119-drm-amdkfd-Fix-compiler-warning.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2119-drm-amdkfd-Fix-compiler-warning.patch
new file mode 100644
index 00000000..ec1c2c90
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2119-drm-amdkfd-Fix-compiler-warning.patch
@@ -0,0 +1,34 @@
+From 369e454ee90ce57ac17c4a1fedef248cab9dfbca Mon Sep 17 00:00:00 2001
+From: Felix Kuehling <Felix.Kuehling@amd.com>
+Date: Thu, 12 Oct 2017 15:05:52 -0400
+Subject: [PATCH 2119/4131] drm/amdkfd: Fix compiler warning
+
+Change-Id: Iaa8fb79ac1accedcc49d416e568ed296c31a6a12
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_events.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+index 835e045..69c3728 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+@@ -176,8 +176,14 @@ static int create_signal_event(struct file *devkfd,
+
+ static int create_other_event(struct kfd_process *p, struct kfd_event *ev)
+ {
++ /* Cast KFD_LAST_NONSIGNAL_EVENT to uint32_t. This allows an
++ * intentional integer overflow to -1 without a compiler
++ * warning. idr_alloc treats a negative value as "maximum
++ * signed integer".
++ */
+ int id = idr_alloc(&p->event_idr, ev, KFD_FIRST_NONSIGNAL_EVENT_ID,
+- KFD_LAST_NONSIGNAL_EVENT_ID + 1, GFP_KERNEL);
++ (uint32_t)KFD_LAST_NONSIGNAL_EVENT_ID + 1,
++ GFP_KERNEL);
+
+ if (id < 0)
+ return id;
+--
+2.7.4
+