~ubuntu-branches/ubuntu/wily/nvidia-graphics-drivers-340-updates/wily-proposed

« back to all changes in this revision

Viewing changes to debian/dkms_nvidia_uvm/patches/buildfix_kernel_3.12.patch

  • Committer: Package Import Robot
  • Author(s): Alberto Milone
  • Date: 2015-02-11 17:24:47 UTC
  • Revision ID: package-import@ubuntu.com-20150211172447-petxn6hj8gow50lg
Tags: 340.76-0ubuntu1
Initial release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From b32ce9509d4039e56f527e2874550eb2cf1a5648 Mon Sep 17 00:00:00 2001
 
2
From: Alberto Milone <alberto.milone@canonical.com>
 
3
Date: Thu, 9 Jan 2014 11:50:51 +0100
 
4
Subject: [PATCH 1/1] uvm: add support for Linux 3.12 (v2)
 
5
 
 
6
If CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled, kuid_t is a struct
 
7
with the uid_t val member, otherwise it's simply an alias for uid_t.
 
8
 
 
9
Despite the commit subject, this is not specific to Linux 3.12.
 
10
 
 
11
Thanks to Joseph Yasi for finding out the issue and suggesting a fix.
 
12
---
 
13
 nvidia_uvm_linux.h |   10 ++++++++--
 
14
 1 file changed, 8 insertions(+), 2 deletions(-)
 
15
 
 
16
diff --git a/nvidia_uvm_linux.h b/nvidia_uvm_linux.h
 
17
index e2b4620..0a38cbc 100644
 
18
--- a/nvidia_uvm_linux.h
 
19
+++ b/nvidia_uvm_linux.h
 
20
@@ -389,11 +389,17 @@ typedef void irqreturn_t;
 
21
 // not require the RCU's read lock on current->cred.
 
22
 //
 
23
 //
 
24
+#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
 
25
+#define NV_KUID_TO_UID(value) (__kuid_val(value))
 
26
+#else
 
27
+#define NV_KUID_TO_UID(value) (value)
 
28
+#endif
 
29
+
 
30
 #if defined(NV_TASK_STRUCT_HAS_CRED)
 
31
 #define NV_CURRENT_EUID() \
 
32
-    (((typeof(*current->cred) __force __kernel *)current->cred)->euid)
 
33
+    NV_KUID_TO_UID(((typeof(*current->cred) __force __kernel *)current->cred)->euid)
 
34
 #else
 
35
-#define NV_CURRENT_EUID() (current->euid)
 
36
+#define NV_CURRENT_EUID() NV_KUID_TO_UID(current->euid)
 
37
 #endif
 
38
 
 
39
 #if !defined(VM_FAULT_NOPAGE)
 
40
-- 
 
41
1.7.9.5
 
42