Commit 57e1a373 authored by Rusty Russell's avatar Rusty Russell

virtio: rpmsg: make it clear that virtqueue_add_buf() no longer returns > 0

We simplified virtqueue_add_buf(), make it clear in the callers.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 0e3daa64
...@@ -764,7 +764,7 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst, ...@@ -764,7 +764,7 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
/* add message to the remote processor's virtqueue */ /* add message to the remote processor's virtqueue */
err = virtqueue_add_buf(vrp->svq, &sg, 1, 0, msg, GFP_KERNEL); err = virtqueue_add_buf(vrp->svq, &sg, 1, 0, msg, GFP_KERNEL);
if (err < 0) { if (err) {
/* /*
* need to reclaim the buffer here, otherwise it's lost * need to reclaim the buffer here, otherwise it's lost
* (memory won't leak, but rpmsg won't use it again for TX). * (memory won't leak, but rpmsg won't use it again for TX).
...@@ -776,8 +776,6 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst, ...@@ -776,8 +776,6 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
/* tell the remote processor it has a pending message to read */ /* tell the remote processor it has a pending message to read */
virtqueue_kick(vrp->svq); virtqueue_kick(vrp->svq);
err = 0;
out: out:
mutex_unlock(&vrp->tx_lock); mutex_unlock(&vrp->tx_lock);
return err; return err;
...@@ -980,7 +978,7 @@ static int rpmsg_probe(struct virtio_device *vdev) ...@@ -980,7 +978,7 @@ static int rpmsg_probe(struct virtio_device *vdev)
err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, cpu_addr, err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, cpu_addr,
GFP_KERNEL); GFP_KERNEL);
WARN_ON(err < 0); /* sanity check; this can't really happen */ WARN_ON(err); /* sanity check; this can't really happen */
} }
/* suppress "tx-complete" interrupts */ /* suppress "tx-complete" interrupts */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment