mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -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
|
|
@ -357,13 +357,13 @@ static void handle_tx(struct vhost_net *net)
|
|||
iov_iter_init(&msg.msg_iter, WRITE, vq->iov, out, len);
|
||||
iov_iter_advance(&msg.msg_iter, hdr_size);
|
||||
/* Sanity check */
|
||||
if (!iov_iter_count(&msg.msg_iter)) {
|
||||
if (!msg_data_left(&msg)) {
|
||||
vq_err(vq, "Unexpected header len for TX: "
|
||||
"%zd expected %zd\n",
|
||||
len, hdr_size);
|
||||
break;
|
||||
}
|
||||
len = iov_iter_count(&msg.msg_iter);
|
||||
len = msg_data_left(&msg);
|
||||
|
||||
zcopy_used = zcopy && len >= VHOST_GOODCOPY_LEN
|
||||
&& (nvq->upend_idx + 1) % UIO_MAXIOV !=
|
||||
|
|
|
|||
Loading…
Reference in a new issue