]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - crypto/shash.c
Merge tag 'stable/for-linus-3.4-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[mv-sheeva.git] / crypto / shash.c
index ea8a9c6e21e371170606863ecb5f8cc7a5030ea8..21fc12e2378f17340d40f264af6deeab51f214d5 100644 (file)
@@ -281,10 +281,10 @@ int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc)
        if (nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset)) {
                void *data;
 
-               data = crypto_kmap(sg_page(sg), 0);
+               data = kmap_atomic(sg_page(sg));
                err = crypto_shash_digest(desc, data + offset, nbytes,
                                          req->result);
-               crypto_kunmap(data, 0);
+               kunmap_atomic(data);
                crypto_yield(desc->flags);
        } else
                err = crypto_shash_init(desc) ?:
@@ -420,9 +420,9 @@ static int shash_compat_digest(struct hash_desc *hdesc, struct scatterlist *sg,
 
                desc->flags = hdesc->flags;
 
-               data = crypto_kmap(sg_page(sg), 0);
+               data = kmap_atomic(sg_page(sg));
                err = crypto_shash_digest(desc, data + offset, nbytes, out);
-               crypto_kunmap(data, 0);
+               kunmap_atomic(data);
                crypto_yield(desc->flags);
                goto out;
        }
@@ -524,6 +524,7 @@ static unsigned int crypto_shash_extsize(struct crypto_alg *alg)
        return alg->cra_ctxsize;
 }
 
+#ifdef CONFIG_NET
 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_hash rhash;
@@ -541,6 +542,12 @@ static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
 nla_put_failure:
        return -EMSGSIZE;
 }
+#else
+static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
+{
+       return -ENOSYS;
+}
+#endif
 
 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg)
        __attribute__ ((unused));