aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/internal.h11
-rw-r--r--crypto/scatterwalk.c8
2 files changed, 8 insertions, 11 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 60acad9788c5..abb01f71f817 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -50,11 +50,16 @@ extern struct list_head crypto_alg_list;
50extern struct rw_semaphore crypto_alg_sem; 50extern struct rw_semaphore crypto_alg_sem;
51extern struct blocking_notifier_head crypto_chain; 51extern struct blocking_notifier_head crypto_chain;
52 52
53extern enum km_type crypto_km_types[];
54
55static inline enum km_type crypto_kmap_type(int out) 53static inline enum km_type crypto_kmap_type(int out)
56{ 54{
57 return crypto_km_types[(in_softirq() ? 2 : 0) + out]; 55 enum km_type type;
56
57 if (in_softirq())
58 type = out * (KM_SOFTIRQ1 - KM_SOFTIRQ0) + KM_SOFTIRQ0;
59 else
60 type = out * (KM_USER1 - KM_USER0) + KM_USER0;
61
62 return type;
58} 63}
59 64
60static inline void *crypto_kmap(struct page *page, int out) 65static inline void *crypto_kmap(struct page *page, int out)
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index e93a8f6f35d4..3052f6507f53 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -23,14 +23,6 @@
23#include "internal.h" 23#include "internal.h"
24#include "scatterwalk.h" 24#include "scatterwalk.h"
25 25
26enum km_type crypto_km_types[] = {
27 KM_USER0,
28 KM_USER1,
29 KM_SOFTIRQ0,
30 KM_SOFTIRQ1,
31};
32EXPORT_SYMBOL_GPL(crypto_km_types);
33
34static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out) 26static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out)
35{ 27{
36 void *src = out ? buf : sgdata; 28 void *src = out ? buf : sgdata;