]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-340xx.git/blame - kernel-5.3.patch
- fix building with kernel 5.3
[packages/xorg-driver-video-nvidia-legacy-340xx.git] / kernel-5.3.patch
CommitLineData
f878b4de
JR
1From df6b6227e19b46cf23abca790570804872cbf87c Mon Sep 17 00:00:00 2001
2From: Alberto Milone <alberto.milone@canonical.com>
3Date: Tue, 13 Aug 2019 11:20:39 +0200
4Subject: [PATCH 1/1] Add support for Linux 5.3
5
6smp_call_function() and on_each_cpu() no longer have return values
7as per commit caa759323c73676b3e48c8d9c86093c88b4aba97
8---
9 nv-linux.h | 18 ++++++++++++++++++
10 1 file changed, 18 insertions(+)
11
12diff --git a/nv-linux.h b/nv-linux.h
13index 4043bf1..62f0874 100644
14--- NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-linux.h
15+++ NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-linux.h
16@@ -877,12 +877,21 @@ extern void *nv_stack_t_cache;
17 __ret; \
18 })
19 #elif (NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT == 3)
20+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
21 #define NV_SMP_CALL_FUNCTION(func, info, wait) \
22 ({ \
23 int __ret = smp_call_function(func, info, wait); \
24 __ret; \
25 })
26 #else
27+#define NV_SMP_CALL_FUNCTION(func, info, wait) \
28+ ({ \
29+ int __ret = 0; \
30+ smp_call_function(func, info, wait); \
31+ __ret; \
32+ })
33+#endif
34+#else
35 #error "NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT value unrecognized!"
36 #endif
37 #elif defined(CONFIG_SMP)
38@@ -897,12 +906,21 @@ extern void *nv_stack_t_cache;
39 __ret; \
40 })
41 #elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3)
42+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
43 #define NV_ON_EACH_CPU(func, info, wait) \
44 ({ \
45 int __ret = on_each_cpu(func, info, wait); \
46 __ret; \
47 })
48 #else
49+#define NV_ON_EACH_CPU(func, info, wait) \
50+ ({ \
51+ int __ret = 0; \
52+ on_each_cpu(func, info, wait); \
53+ __ret; \
54+ })
55+#endif
56+#else
57 #error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!"
58 #endif
59 #elif defined(CONFIG_SMP)
60--
612.20.1
62
This page took 0.03632 seconds and 4 git commands to generate.