aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-15 21:39:31 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 15:53:35 -0400
commit01e97e6517053d7c0b9af5248e944a9209909cf5 (patch)
tree30f57eededa62a390543b3a596d81006deb22384 /crypto
parenta2dd3793a1c3ac709f1d7b48ad7751563f4c654f (diff)
new helper: msg_data_left()
convert open-coded instances Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/algif_hash.c4
-rw-r--r--crypto/algif_skcipher.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index 0a465e0f3012..1396ad0787fc 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -56,8 +56,8 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
56 56
57 ctx->more = 0; 57 ctx->more = 0;
58 58
59 while (iov_iter_count(&msg->msg_iter)) { 59 while (msg_data_left(msg)) {
60 int len = iov_iter_count(&msg->msg_iter); 60 int len = msg_data_left(msg);
61 61
62 if (len > limit) 62 if (len > limit)
63 len = limit; 63 len = limit;
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 8f903b6df299..945075292bc9 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -641,7 +641,7 @@ static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg,
641 long copied = 0; 641 long copied = 0;
642 642
643 lock_sock(sk); 643 lock_sock(sk);
644 while (iov_iter_count(&msg->msg_iter)) { 644 while (msg_data_left(msg)) {
645 sgl = list_first_entry(&ctx->tsgl, 645 sgl = list_first_entry(&ctx->tsgl,
646 struct skcipher_sg_list, list); 646 struct skcipher_sg_list, list);
647 sg = sgl->sg; 647 sg = sgl->sg;
@@ -655,7 +655,7 @@ static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg,
655 goto unlock; 655 goto unlock;
656 } 656 }
657 657
658 used = min_t(unsigned long, ctx->used, iov_iter_count(&msg->msg_iter)); 658 used = min_t(unsigned long, ctx->used, msg_data_left(msg));
659 659
660 used = af_alg_make_sg(&ctx->rsgl, &msg->msg_iter, used); 660 used = af_alg_make_sg(&ctx->rsgl, &msg->msg_iter, used);
661 err = used; 661 err = used;