mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
new helper: msg_data_left()
convert open-coded instances Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a2dd3793a1
commit
01e97e6517
8 changed files with 27 additions and 23 deletions
|
|
@ -56,8 +56,8 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
|
|||
|
||||
ctx->more = 0;
|
||||
|
||||
while (iov_iter_count(&msg->msg_iter)) {
|
||||
int len = iov_iter_count(&msg->msg_iter);
|
||||
while (msg_data_left(msg)) {
|
||||
int len = msg_data_left(msg);
|
||||
|
||||
if (len > limit)
|
||||
len = limit;
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg,
|
|||
long copied = 0;
|
||||
|
||||
lock_sock(sk);
|
||||
while (iov_iter_count(&msg->msg_iter)) {
|
||||
while (msg_data_left(msg)) {
|
||||
sgl = list_first_entry(&ctx->tsgl,
|
||||
struct skcipher_sg_list, list);
|
||||
sg = sgl->sg;
|
||||
|
|
@ -655,7 +655,7 @@ static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg,
|
|||
goto unlock;
|
||||
}
|
||||
|
||||
used = min_t(unsigned long, ctx->used, iov_iter_count(&msg->msg_iter));
|
||||
used = min_t(unsigned long, ctx->used, msg_data_left(msg));
|
||||
|
||||
used = af_alg_make_sg(&ctx->rsgl, &msg->msg_iter, used);
|
||||
err = used;
|
||||
|
|
|
|||
Loading…
Reference in a new issue