]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SG] Update crypto/ to sg helpers
authorJens Axboe <jens.axboe@oracle.com>
Mon, 22 Oct 2007 17:40:16 +0000 (19:40 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 22 Oct 2007 17:40:16 +0000 (19:40 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
crypto/digest.c
crypto/hmac.c
crypto/scatterwalk.c
crypto/scatterwalk.h
crypto/tcrypt.c
crypto/xcbc.c

index e56de6748b155eadf0f749c801e911a9a2d23577..8871dec8cae7484a1fe34e68966563ad1d6032b9 100644 (file)
@@ -41,7 +41,7 @@ static int update2(struct hash_desc *desc,
                return 0;
 
        for (;;) {
-               struct page *pg = sg->page;
+               struct page *pg = sg_page(sg);
                unsigned int offset = sg->offset;
                unsigned int l = sg->length;
 
index 8802fb6dd5a6c857e4d78880944d5f9c3cc6c9d4..e4eb6ac53b5c0b68e01643ce0ec2be97bca35939 100644 (file)
@@ -159,7 +159,8 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
        desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
 
        sg_set_buf(sg1, ipad, bs);
-       sg1[1].page = (void *)sg;
+
+       sg_set_page(&sg[1], (void *) sg);
        sg1[1].length = 0;
        sg_set_buf(sg2, opad, bs + ds);
 
index d6852c33cfb78f2ac2300280f90dadc6acb3b5a7..b9bbda0bb9f968efc4a728dd316952b7516f617b 100644 (file)
@@ -54,7 +54,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
        if (out) {
                struct page *page;
 
-               page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT);
+               page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT);
                flush_dcache_page(page);
        }
 
index 9c73e37a42cef9ad9eb63133cf78a35ac78ae9fd..87ed681cceba4fa42d9d46399560d6972aadbce2 100644 (file)
 
 static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
 {
-       return (++sg)->length ? sg : (void *)sg->page;
+       return (++sg)->length ? sg : (void *) sg_page(sg);
 }
 
 static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
                                                struct scatter_walk *walk_out)
 {
-       return !(((walk_in->sg->page - walk_out->sg->page) << PAGE_SHIFT) +
+       return !(((sg_page(walk_in->sg) - sg_page(walk_out->sg)) << PAGE_SHIFT) +
                 (int)(walk_in->offset - walk_out->offset));
 }
 
@@ -60,7 +60,7 @@ static inline unsigned int scatterwalk_aligned(struct scatter_walk *walk,
 
 static inline struct page *scatterwalk_page(struct scatter_walk *walk)
 {
-       return walk->sg->page + (walk->offset >> PAGE_SHIFT);
+       return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT);
 }
 
 static inline void scatterwalk_unmap(void *vaddr, int out)
index 18d489c8b935f3834fdf72743d1e1ef0e2acd457..d741c63af42c501f357eb9d666de461265d9c6e8 100644 (file)
@@ -317,7 +317,7 @@ static void test_cipher(char *algo, int enc,
                                goto out;
                        }
 
-                       q = kmap(sg[0].page) + sg[0].offset;
+                       q = kmap(sg_page(&sg[0])) + sg[0].offset;
                        hexdump(q, cipher_tv[i].rlen);
 
                        printk("%s\n",
@@ -390,7 +390,7 @@ static void test_cipher(char *algo, int enc,
                        temp = 0;
                        for (k = 0; k < cipher_tv[i].np; k++) {
                                printk("page %u\n", k);
-                               q = kmap(sg[k].page) + sg[k].offset;
+                               q = kmap(sg_page(&sg[k])) + sg[k].offset;
                                hexdump(q, cipher_tv[i].tap[k]);
                                printk("%s\n",
                                        memcmp(q, cipher_tv[i].result + temp,
index 9f502b86e0ea563ac04b31fbf96dcd534367e05a..ac68f3b62fde7c533cd1d1faf8c169c313864773 100644 (file)
@@ -120,7 +120,7 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
 
        do {
 
-               struct page *pg = sg[i].page;
+               struct page *pg = sg_page(&sg[i]);
                unsigned int offset = sg[i].offset;
                unsigned int slen = sg[i].length;