提交 70dec235 编写于 作者: H Herbert Xu 提交者: David S. Miller

[CRYPTO] api: Kill crypto_km_types

When scatterwalk is built as a module digest.c was broken because it
requires the crypto_km_types structure which is in scatterwalk.  This
patch removes the crypto_km_types structure by encoding the logic into
crypto_kmap_type directly.

In fact, this even saves a few bytes of code (not to mention the data
structure itself) on i386 which is about the only place where it's
needed.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 3c09f17c
...@@ -50,11 +50,16 @@ extern struct list_head crypto_alg_list; ...@@ -50,11 +50,16 @@ extern struct list_head crypto_alg_list;
extern struct rw_semaphore crypto_alg_sem; extern struct rw_semaphore crypto_alg_sem;
extern struct blocking_notifier_head crypto_chain; extern struct blocking_notifier_head crypto_chain;
extern enum km_type crypto_km_types[];
static inline enum km_type crypto_kmap_type(int out) static inline enum km_type crypto_kmap_type(int out)
{ {
return crypto_km_types[(in_softirq() ? 2 : 0) + out]; enum km_type type;
if (in_softirq())
type = out * (KM_SOFTIRQ1 - KM_SOFTIRQ0) + KM_SOFTIRQ0;
else
type = out * (KM_USER1 - KM_USER0) + KM_USER0;
return type;
} }
static inline void *crypto_kmap(struct page *page, int out) static inline void *crypto_kmap(struct page *page, int out)
......
...@@ -23,14 +23,6 @@ ...@@ -23,14 +23,6 @@
#include "internal.h" #include "internal.h"
#include "scatterwalk.h" #include "scatterwalk.h"
enum km_type crypto_km_types[] = {
KM_USER0,
KM_USER1,
KM_SOFTIRQ0,
KM_SOFTIRQ1,
};
EXPORT_SYMBOL_GPL(crypto_km_types);
static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out) static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out)
{ {
void *src = out ? buf : sgdata; void *src = out ? buf : sgdata;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册