aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/files/0017-remove-dead-code.patch
blob: b3c36b3d96d00b37a3eefbde8c542f36db4d4517 (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
From 0ca641091b4113d73e75d30ef530c88836849308 Mon Sep 17 00:00:00 2001
From: Tudor Ambarus <tudor.ambarus@freescale.com>
Date: Fri, 29 May 2015 15:28:47 +0300
Subject: [PATCH 17/20] remove dead code

Functions kop_to_user and compat_kop_to_user are never used. Delete them
to avoid compiler warnings.


crypto/../../cryptodev-linux/ioctl.c:841:12: warning: 'kop_to_user' defined but not used [-Wunused-function]
 static int kop_to_user(struct kernel_crypt_kop *kop,
            ^
crypto/../../cryptodev-linux/ioctl.c: At top level:
crypto/../../cryptodev-linux/ioctl.c:1195:12: warning: 'compat_kop_to_user' defined but not used [-Wunused-function]
 static int compat_kop_to_user(struct kernel_crypt_kop *kop, void __user *arg)
            ^
Signed-off-by: Tudor Ambarus <tudor.ambarus@freescale.com>
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Change-Id: I6bd8a7eb6144224a20cd400813ab15a7a192dbb1
Reviewed-on: http://git.am.freescale.net:8181/37440
---
 ioctl.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/ioctl.c b/ioctl.c
index 53dbf64..39635a4 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -838,16 +838,6 @@ static int kop_from_user(struct kernel_crypt_kop *kop,
 	return fill_kop_from_cop(kop);
 }
 
-static int kop_to_user(struct kernel_crypt_kop *kop,
-			void __user *arg)
-{
-	if (unlikely(copy_to_user(arg, &kop->kop, sizeof(kop->kop)))) {
-		dprintk(1, KERN_ERR, "Cannot copy to userspace\n");
-		return -EFAULT;
-	}
-	return 0;
-}
-
 static int kcop_from_user(struct kernel_crypt_op *kcop,
 			struct fcrypt *fcr, void __user *arg)
 {
@@ -1192,18 +1182,6 @@ static inline void crypt_kop_to_compat(struct crypt_kop *kop,
 	compat->curve_type = kop->curve_type;
 }
 
-static int compat_kop_to_user(struct kernel_crypt_kop *kop, void __user *arg)
-{
-	struct compat_crypt_kop compat_kop;
-
-	crypt_kop_to_compat(&kop->kop, &compat_kop);
-	if (unlikely(copy_to_user(arg, &compat_kop, sizeof(compat_kop)))) {
-		dprintk(1, KERN_ERR, "Cannot copy to userspace\n");
-		return -EFAULT;
-	}
-	return 0;
-}
-
 static inline void
 compat_to_session_op(struct compat_session_op *compat, struct session_op *sop)
 {
-- 
2.3.5