Package: broadcom-sta / 6.30.223.271-10

13-linux414.patch Patch series | download
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
From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar>
Date: Fri, 29 Dec 2017 23:44:24 -0400
Subject: linux414
Origin: https://bugs.debian.org/885885

linux 4.14 changed the kernel_read function prototype.
---
 amd64/src/shared/linux_osl.c | 12 +++++++++++-
 i386/src/shared/linux_osl.c  |  4 ++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/amd64/src/shared/linux_osl.c b/amd64/src/shared/linux_osl.c
index 9adc392..b24a973 100644
--- a/amd64/src/shared/linux_osl.c
+++ b/amd64/src/shared/linux_osl.c
@@ -1076,11 +1076,21 @@ osl_os_get_image_block(char *buf, int len, void *image)
 {
 	struct file *fp = (struct file *)image;
 	int rdlen;
+	loff_t pos;
 
 	if (!image)
 		return 0;
 
-	rdlen = kernel_read(fp, fp->f_pos, buf, len);
+	pos = fp->f_pos;
+	rdlen = kernel_read(fp,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+			pos,
+#endif
+			buf, len
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+			,&pos
+#endif
+	);
 	if (rdlen > 0)
 		fp->f_pos += rdlen;
 
diff --git a/i386/src/shared/linux_osl.c b/i386/src/shared/linux_osl.c
index 6157d18..3188745 100644
--- a/i386/src/shared/linux_osl.c
+++ b/i386/src/shared/linux_osl.c
@@ -1076,7 +1076,11 @@ osl_os_get_image_block(char *buf, int len, void *image)
 	if (!image)
 		return 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+	rdlen = kernel_read(fp, buf, len, &fp->f_pos);
+#else
 	rdlen = kernel_read(fp, fp->f_pos, buf, len);
+#endif
 	if (rdlen > 0)
 		fp->f_pos += rdlen;