Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78c2f0b8 authored by Jens Axboe's avatar Jens Axboe
Browse files

[SG] Update crypto/ to sg helpers

parent 9b61764b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;

+2 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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);
	}

+3 −3
Original line number Diff line number Diff line
@@ -22,13 +22,13 @@

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)
+2 −2
Original line number Diff line number Diff line
@@ -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,
Loading