Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: arm/ghash - use the new scatterwalk functions

Use scatterwalk_next() which consolidates scatterwalk_clamp() and
scatterwalk_map(), and use scatterwalk_done_src() which consolidates
scatterwalk_unmap(), scatterwalk_advance(), and scatterwalk_done().
Remove unnecessary code that seemed to be intended to advance to the
next sg entry, which is already handled by the scatterwalk functions.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
5dc14e0b c89edd93

+4 -11
+4 -11
arch/arm/crypto/ghash-ce-glue.c
··· 459 459 scatterwalk_start(&walk, req->src); 460 460 461 461 do { 462 - u32 n = scatterwalk_clamp(&walk, len); 463 - u8 *p; 462 + unsigned int n; 463 + const u8 *p; 464 464 465 - if (!n) { 466 - scatterwalk_start(&walk, sg_next(walk.sg)); 467 - n = scatterwalk_clamp(&walk, len); 468 - } 469 - 470 - p = scatterwalk_map(&walk); 465 + p = scatterwalk_next(&walk, len, &n); 471 466 gcm_update_mac(dg, p, n, buf, &buf_count, ctx); 472 - scatterwalk_unmap(p); 467 + scatterwalk_done_src(&walk, p, n); 473 468 474 469 if (unlikely(len / SZ_4K > (len - n) / SZ_4K)) { 475 470 kernel_neon_end(); ··· 472 477 } 473 478 474 479 len -= n; 475 - scatterwalk_advance(&walk, n); 476 - scatterwalk_done(&walk, 0, len); 477 480 } while (len); 478 481 479 482 if (buf_count) {