Skip to content

Commit 41e4af6

Browse files
Zhi Yong Wudavem330
authored andcommitted
macvtap: remove useless codes in macvtap_aio_read() and macvtap_recvmsg()
By checking related codes, it is impossible that ret > len or total_len, so we should remove some useless coeds in both above functions. Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ca2f09f commit 41e4af6

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/net/macvtap.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,6 @@ static ssize_t macvtap_aio_read(struct kiocb *iocb, const struct iovec *iv,
871871
}
872872

873873
ret = macvtap_do_read(q, iv, len, file->f_flags & O_NONBLOCK);
874-
ret = min_t(ssize_t, ret, len); /* XXX copied from tun.c. Why? */
875874
if (ret > 0)
876875
iocb->ki_pos = ret;
877876
out:
@@ -1106,10 +1105,6 @@ static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock,
11061105
return -EINVAL;
11071106
ret = macvtap_do_read(q, m->msg_iov, total_len,
11081107
flags & MSG_DONTWAIT);
1109-
if (ret > total_len) {
1110-
m->msg_flags |= MSG_TRUNC;
1111-
ret = flags & MSG_TRUNC ? ret : total_len;
1112-
}
11131108
return ret;
11141109
}
11151110

0 commit comments

Comments
 (0)