Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70dec235d8ac8cfb56ed2a3597e7d6c5b801f018
Commit:     70dec235d8ac8cfb56ed2a3597e7d6c5b801f018
Parent:     3c09f17c3d11f3e98928f55b600e6de22f58017a
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Sat Sep 1 16:52:13 2007 +0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:55:44 2007 -0700

    [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 <[EMAIL PROTECTED]>
---
 crypto/internal.h    |   11 ++++++++---
 crypto/scatterwalk.c |    8 --------
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/crypto/internal.h b/crypto/internal.h
index 60acad9..abb01f7 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)
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index e93a8f6..3052f65 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -23,14 +23,6 @@
 #include "internal.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)
 {
        void *src = out ? buf : sgdata;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to