diff options
-rw-r--r-- | crypto/digest.c | 2 | ||||
-rw-r--r-- | crypto/hmac.c | 3 | ||||
-rw-r--r-- | crypto/scatterwalk.c | 2 | ||||
-rw-r--r-- | crypto/scatterwalk.h | 6 | ||||
-rw-r--r-- | crypto/tcrypt.c | 4 | ||||
-rw-r--r-- | crypto/xcbc.c | 2 |
6 files changed, 10 insertions, 9 deletions
diff --git a/crypto/digest.c b/crypto/digest.c index e56de6748b15..8871dec8cae7 100644 --- a/crypto/digest.c +++ b/crypto/digest.c | |||
@@ -41,7 +41,7 @@ static int update2(struct hash_desc *desc, | |||
41 | return 0; | 41 | return 0; |
42 | 42 | ||
43 | for (;;) { | 43 | for (;;) { |
44 | struct page *pg = sg->page; | 44 | struct page *pg = sg_page(sg); |
45 | unsigned int offset = sg->offset; | 45 | unsigned int offset = sg->offset; |
46 | unsigned int l = sg->length; | 46 | unsigned int l = sg->length; |
47 | 47 | ||
diff --git a/crypto/hmac.c b/crypto/hmac.c index 8802fb6dd5a6..e4eb6ac53b5c 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c | |||
@@ -159,7 +159,8 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg, | |||
159 | desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; | 159 | desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; |
160 | 160 | ||
161 | sg_set_buf(sg1, ipad, bs); | 161 | sg_set_buf(sg1, ipad, bs); |
162 | sg1[1].page = (void *)sg; | 162 | |
163 | sg_set_page(&sg[1], (void *) sg); | ||
163 | sg1[1].length = 0; | 164 | sg1[1].length = 0; |
164 | sg_set_buf(sg2, opad, bs + ds); | 165 | sg_set_buf(sg2, opad, bs + ds); |
165 | 166 | ||
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index d6852c33cfb7..b9bbda0bb9f9 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c | |||
@@ -54,7 +54,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out, | |||
54 | if (out) { | 54 | if (out) { |
55 | struct page *page; | 55 | struct page *page; |
56 | 56 | ||
57 | page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT); | 57 | page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT); |
58 | flush_dcache_page(page); | 58 | flush_dcache_page(page); |
59 | } | 59 | } |
60 | 60 | ||
diff --git a/crypto/scatterwalk.h b/crypto/scatterwalk.h index 9c73e37a42ce..87ed681cceba 100644 --- a/crypto/scatterwalk.h +++ b/crypto/scatterwalk.h | |||
@@ -22,13 +22,13 @@ | |||
22 | 22 | ||
23 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | 23 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
24 | { | 24 | { |
25 | return (++sg)->length ? sg : (void *)sg->page; | 25 | return (++sg)->length ? sg : (void *) sg_page(sg); |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, | 28 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, |
29 | struct scatter_walk *walk_out) | 29 | struct scatter_walk *walk_out) |
30 | { | 30 | { |
31 | return !(((walk_in->sg->page - walk_out->sg->page) << PAGE_SHIFT) + | 31 | return !(((sg_page(walk_in->sg) - sg_page(walk_out->sg)) << PAGE_SHIFT) + |
32 | (int)(walk_in->offset - walk_out->offset)); | 32 | (int)(walk_in->offset - walk_out->offset)); |
33 | } | 33 | } |
34 | 34 | ||
@@ -60,7 +60,7 @@ static inline unsigned int scatterwalk_aligned(struct scatter_walk *walk, | |||
60 | 60 | ||
61 | static inline struct page *scatterwalk_page(struct scatter_walk *walk) | 61 | static inline struct page *scatterwalk_page(struct scatter_walk *walk) |
62 | { | 62 | { |
63 | return walk->sg->page + (walk->offset >> PAGE_SHIFT); | 63 | return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void scatterwalk_unmap(void *vaddr, int out) | 66 | static inline void scatterwalk_unmap(void *vaddr, int out) |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 18d489c8b935..d741c63af42c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -317,7 +317,7 @@ static void test_cipher(char *algo, int enc, | |||
317 | goto out; | 317 | goto out; |
318 | } | 318 | } |
319 | 319 | ||
320 | q = kmap(sg[0].page) + sg[0].offset; | 320 | q = kmap(sg_page(&sg[0])) + sg[0].offset; |
321 | hexdump(q, cipher_tv[i].rlen); | 321 | hexdump(q, cipher_tv[i].rlen); |
322 | 322 | ||
323 | printk("%s\n", | 323 | printk("%s\n", |
@@ -390,7 +390,7 @@ static void test_cipher(char *algo, int enc, | |||
390 | temp = 0; | 390 | temp = 0; |
391 | for (k = 0; k < cipher_tv[i].np; k++) { | 391 | for (k = 0; k < cipher_tv[i].np; k++) { |
392 | printk("page %u\n", k); | 392 | printk("page %u\n", k); |
393 | q = kmap(sg[k].page) + sg[k].offset; | 393 | q = kmap(sg_page(&sg[k])) + sg[k].offset; |
394 | hexdump(q, cipher_tv[i].tap[k]); | 394 | hexdump(q, cipher_tv[i].tap[k]); |
395 | printk("%s\n", | 395 | printk("%s\n", |
396 | memcmp(q, cipher_tv[i].result + temp, | 396 | memcmp(q, cipher_tv[i].result + temp, |
diff --git a/crypto/xcbc.c b/crypto/xcbc.c index 9f502b86e0ea..ac68f3b62fde 100644 --- a/crypto/xcbc.c +++ b/crypto/xcbc.c | |||
@@ -120,7 +120,7 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc, | |||
120 | 120 | ||
121 | do { | 121 | do { |
122 | 122 | ||
123 | struct page *pg = sg[i].page; | 123 | struct page *pg = sg_page(&sg[i]); |
124 | unsigned int offset = sg[i].offset; | 124 | unsigned int offset = sg[i].offset; |
125 | unsigned int slen = sg[i].length; | 125 | unsigned int slen = sg[i].length; |
126 | 126 | ||