summaryrefslogtreecommitdiff
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-09-01 16:52:13 +0800
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:55:44 -0700
commit69646b10d6c4dfcab5b7f49c2569e91c730fc121 (patch)
treede6cbe171b8c188f879bb2c34dbe7e62723cc2f9 /crypto/internal.h
parent850db7faf509cfc553bb522ba7dcb649c92d8c37 (diff)
downloadlinux-crypto-69646b10d6c4dfcab5b7f49c2569e91c730fc121.tar.gz
linux-crypto-69646b10d6c4dfcab5b7f49c2569e91c730fc121.zip
[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: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 60acad97..abb01f71 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -50,11 +50,16 @@ extern struct list_head crypto_alg_list;
extern struct rw_semaphore crypto_alg_sem;
extern struct blocking_notifier_head crypto_chain;
-extern enum km_type crypto_km_types[];
-
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)