]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
crypto: replace scatterwalk_sg_chain with sg_chain
authorDan Williams <dan.j.williams@intel.com>
Fri, 7 Aug 2015 16:15:13 +0000 (18:15 +0200)
committerJens Axboe <axboe@fb.com>
Mon, 17 Aug 2015 14:12:54 +0000 (08:12 -0600)
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
[hch: split from a larger patch by Dan]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jens Axboe <axboe@fb.com>
crypto/algif_skcipher.c
crypto/ccm.c
crypto/gcm.c
drivers/crypto/bfin_crc.c
drivers/crypto/qce/sha.c
drivers/crypto/sahara.c
drivers/crypto/talitos.c
include/crypto/scatterwalk.h

index 945075292bc9584e57f4612bb1b7549a8e9e9b22..af31a0ee4057370593536cb9f8cc0a4343ab91b8 100644 (file)
@@ -145,7 +145,7 @@ static int skcipher_alloc_sgl(struct sock *sk)
                sgl->cur = 0;
 
                if (sg)
-                       scatterwalk_sg_chain(sg, MAX_SGL_ENTS + 1, sgl->sg);
+                       sg_chain(sg, MAX_SGL_ENTS + 1, sgl->sg);
 
                list_add_tail(&sgl->list, &ctx->tsgl);
        }
index a4d1a5eda18b4e9758ec899fdf48c6f1359a8c14..b3f52f50d1c12e1a9564aa35d33b03dd2b85a842 100644 (file)
@@ -329,13 +329,13 @@ static int crypto_ccm_encrypt(struct aead_request *req)
 
        sg_init_table(pctx->src, 2);
        sg_set_buf(pctx->src, odata, 16);
-       scatterwalk_sg_chain(pctx->src, 2, req->src);
+       sg_chain(pctx->src, 2, req->src);
 
        dst = pctx->src;
        if (req->src != req->dst) {
                sg_init_table(pctx->dst, 2);
                sg_set_buf(pctx->dst, odata, 16);
-               scatterwalk_sg_chain(pctx->dst, 2, req->dst);
+               sg_chain(pctx->dst, 2, req->dst);
                dst = pctx->dst;
        }
 
@@ -400,13 +400,13 @@ static int crypto_ccm_decrypt(struct aead_request *req)
 
        sg_init_table(pctx->src, 2);
        sg_set_buf(pctx->src, authtag, 16);
-       scatterwalk_sg_chain(pctx->src, 2, req->src);
+       sg_chain(pctx->src, 2, req->src);
 
        dst = pctx->src;
        if (req->src != req->dst) {
                sg_init_table(pctx->dst, 2);
                sg_set_buf(pctx->dst, authtag, 16);
-               scatterwalk_sg_chain(pctx->dst, 2, req->dst);
+               sg_chain(pctx->dst, 2, req->dst);
                dst = pctx->dst;
        }
 
index 7d32d4720564315f57a2766f5e1813d536d9ee69..ab0b2f9e8fad707c8010c8f0b6c9817fe0f9e80c 100644 (file)
@@ -200,14 +200,14 @@ static void crypto_gcm_init_common(struct aead_request *req)
        sg_set_buf(pctx->src, pctx->auth_tag, sizeof(pctx->auth_tag));
        sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen);
        if (sg != pctx->src + 1)
-               scatterwalk_sg_chain(pctx->src, 2, sg);
+               sg_chain(pctx->src, 2, sg);
 
        if (req->src != req->dst) {
                sg_init_table(pctx->dst, 3);
                sg_set_buf(pctx->dst, pctx->auth_tag, sizeof(pctx->auth_tag));
                sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen);
                if (sg != pctx->dst + 1)
-                       scatterwalk_sg_chain(pctx->dst, 2, sg);
+                       sg_chain(pctx->dst, 2, sg);
        }
 }
 
index d9af9403ab6cd3fdfd293699b46ae6836767c61d..2f0b3337505da4e24664db8918ca9028a8eecd8c 100644 (file)
@@ -370,8 +370,7 @@ static int bfin_crypto_crc_handle_queue(struct bfin_crypto_crc *crc,
                        sg_init_table(ctx->bufsl, nsg);
                        sg_set_buf(ctx->bufsl, ctx->buflast, ctx->buflast_len);
                        if (nsg > 1)
-                               scatterwalk_sg_chain(ctx->bufsl, nsg,
-                                               req->src);
+                               sg_chain(ctx->bufsl, nsg, req->src);
                        ctx->sg = ctx->bufsl;
                } else
                        ctx->sg = req->src;
index 5c5df1d17f90036d95b90247fe9e0c4d164968c9..be2f5049256af5e846c49a66da40f420f5e6a6ae 100644 (file)
@@ -296,7 +296,7 @@ static int qce_ahash_update(struct ahash_request *req)
        if (rctx->buflen) {
                sg_init_table(rctx->sg, 2);
                sg_set_buf(rctx->sg, rctx->tmpbuf, rctx->buflen);
-               scatterwalk_sg_chain(rctx->sg, 2, req->src);
+               sg_chain(rctx->sg, 2, req->src);
                req->src = rctx->sg;
        }
 
index 397a500b3d8a9edbaf214ae28a8cc88e64582eb0..a75cf66977283cebe267fcccd1c369e8cc1a1180 100644 (file)
@@ -999,7 +999,7 @@ static int sahara_sha_prepare_request(struct ahash_request *req)
                sg_init_table(rctx->in_sg_chain, 2);
                sg_set_buf(rctx->in_sg_chain, rctx->rembuf, rctx->buf_cnt);
 
-               scatterwalk_sg_chain(rctx->in_sg_chain, 2, req->src);
+               sg_chain(rctx->in_sg_chain, 2, req->src);
 
                rctx->total = req->nbytes + rctx->buf_cnt;
                rctx->in_sg = rctx->in_sg_chain;
index 83aca95a95bc226e6b3d1b083c7ba5373660cc6b..6a7f02412881335edad0bdebda156921605a812b 100644 (file)
@@ -1986,7 +1986,7 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)
                sg_init_table(req_ctx->bufsl, nsg);
                sg_set_buf(req_ctx->bufsl, req_ctx->buf, req_ctx->nbuf);
                if (nsg > 1)
-                       scatterwalk_sg_chain(req_ctx->bufsl, 2, areq->src);
+                       sg_chain(req_ctx->bufsl, 2, areq->src);
                req_ctx->psrc = req_ctx->bufsl;
        } else
                req_ctx->psrc = areq->src;
index 96670e7e7c145f741b104afccae780b95b22a41d..35f99b68d037066b987a90ae24b6b6ba5bd00d09 100644 (file)
 #include <linux/scatterlist.h>
 #include <linux/sched.h>
 
-static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num,
-                                       struct scatterlist *sg2)
-{
-       sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0);
-       sg1[num - 1].page_link &= ~0x02;
-       sg1[num - 1].page_link |= 0x01;
-}
-
 static inline void scatterwalk_crypto_chain(struct scatterlist *head,
                                            struct scatterlist *sg,
                                            int chain, int num)
@@ -43,7 +35,7 @@ static inline void scatterwalk_crypto_chain(struct scatterlist *head,
        }
 
        if (sg)
-               scatterwalk_sg_chain(head, num, sg);
+               sg_chain(head, num, sg);
        else
                sg_mark_end(head);
 }