diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-10-16 09:26:15 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-17 23:50:36 -0500 |
commit | 57e1a37347d31c6b5c34eda1ecb2272f1803323d (patch) | |
tree | bb23342c2dc40a67c7b1af6a3ad5f2f59a248452 /drivers/rpmsg | |
parent | 0e3daa6491699640b9efc321d61310aee9a809d5 (diff) |
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: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r-- | drivers/rpmsg/virtio_rpmsg_bus.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 1859f71372e2..027096fe6a12 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c | |||
@@ -764,7 +764,7 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst, | |||
764 | 764 | ||
765 | /* add message to the remote processor's virtqueue */ | 765 | /* add message to the remote processor's virtqueue */ |
766 | err = virtqueue_add_buf(vrp->svq, &sg, 1, 0, msg, GFP_KERNEL); | 766 | err = virtqueue_add_buf(vrp->svq, &sg, 1, 0, msg, GFP_KERNEL); |
767 | if (err < 0) { | 767 | if (err) { |
768 | /* | 768 | /* |
769 | * need to reclaim the buffer here, otherwise it's lost | 769 | * need to reclaim the buffer here, otherwise it's lost |
770 | * (memory won't leak, but rpmsg won't use it again for TX). | 770 | * (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 | 776 | ||
777 | /* tell the remote processor it has a pending message to read */ | 777 | /* tell the remote processor it has a pending message to read */ |
778 | virtqueue_kick(vrp->svq); | 778 | virtqueue_kick(vrp->svq); |
779 | |||
780 | err = 0; | ||
781 | out: | 779 | out: |
782 | mutex_unlock(&vrp->tx_lock); | 780 | mutex_unlock(&vrp->tx_lock); |
783 | return err; | 781 | return err; |
@@ -980,7 +978,7 @@ static int rpmsg_probe(struct virtio_device *vdev) | |||
980 | 978 | ||
981 | err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, cpu_addr, | 979 | err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, cpu_addr, |
982 | GFP_KERNEL); | 980 | GFP_KERNEL); |
983 | WARN_ON(err < 0); /* sanity check; this can't really happen */ | 981 | WARN_ON(err); /* sanity check; this can't really happen */ |
984 | } | 982 | } |
985 | 983 | ||
986 | /* suppress "tx-complete" interrupts */ | 984 | /* suppress "tx-complete" interrupts */ |