diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-10-16 23:56:15 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-18 15:20:36 +1030 |
commit | 57e1a37347d31c6b5c34eda1ecb2272f1803323d (patch) | |
tree | bb23342c2dc40a67c7b1af6a3ad5f2f59a248452 /drivers/rpmsg/virtio_rpmsg_bus.c | |
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/virtio_rpmsg_bus.c')
-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 1859f71372e..027096fe6a1 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, /* add message to the remote processor's virtqueue */ 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 * (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, /* tell the remote processor it has a pending message to read */ virtqueue_kick(vrp->svq); - - err = 0; out: mutex_unlock(&vrp->tx_lock); return err; @@ -980,7 +978,7 @@ static int rpmsg_probe(struct virtio_device *vdev) err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, cpu_addr, 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 */ |