qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 06/12] char: add an edge event API for the front


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 06/12] char: add an edge event API for the front ends
Date: Mon, 1 Aug 2011 16:39:29 +0100

On Mon, Aug 1, 2011 at 3:23 PM, Anthony Liguori <address@hidden> wrote:
> Signed-off-by: Anthony Liguori <address@hidden>
> ---
>  qemu-char.c |   91 
> +++++++++++++++++++++++++++++++++++++++++++++++++----------
>  qemu-char.h |    9 ++++++
>  2 files changed, 85 insertions(+), 15 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 0e4a30c..9e40e04 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -139,13 +139,23 @@ void qemu_chr_generic_open(CharDriverState *s)
>     }
>  }
>
> +static uint32_t char_queue_get_avail(CharQueue *q)
> +{
> +    return sizeof(q->ring) - (q->prod - q->cons);
> +}
> +
> +static bool char_queue_get_empty(CharQueue *q)
> +{
> +    return (q->cons == q->prod);
> +}

bool function naming nitpick: char_queue_is_empty() is clearer than
char_queue_get_empty().  "is" and "has" are always bool, "get" could
return anything.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]