From 6be9f15aa64801bbe4fb404679c7b0793eeea3f9 Mon Sep 17 00:00:00 2001 From: Peter Fang Date: Sun, 17 Mar 2019 01:53:40 -0700 Subject: [PATCH] dm: virtio: change return type to bool Change return type to bool when returning int is not necessary. Tracked-On: #2763 Signed-off-by: Peter Fang Reviewed-by: Shuo A Liu --- devicemodel/include/virtio.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/devicemodel/include/virtio.h b/devicemodel/include/virtio.h index c217fabc1..1c1e2f269 100644 --- a/devicemodel/include/virtio.h +++ b/devicemodel/include/virtio.h @@ -454,24 +454,24 @@ struct virtio_vq_info { * * @param vq Pointer to struct virtio_vq_info. * - * @return 0 on not ready and 1 on ready. + * @return false on not ready and true on ready. */ -static inline int +static inline bool vq_ring_ready(struct virtio_vq_info *vq) { - return (vq->flags & VQ_ALLOC); + return ((vq->flags & VQ_ALLOC) == VQ_ALLOC); } /** * @brief Are there "available" descriptors? * - * This does not count how many, just returns 1 if there is any. + * This does not count how many, just returns true if there is any. * * @param vq Pointer to struct virtio_vq_info. * - * @return 0 on no available and 1 on available. + * @return false on not available and true on available. */ -static inline int +static inline bool vq_has_descs(struct virtio_vq_info *vq) { return (vq_ring_ready(vq) && vq->last_avail !=