From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnube-0005jn-Jb for qemu-devel@nongnu.org; Mon, 01 Aug 2011 11:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnubd-0006bY-Ji for qemu-devel@nongnu.org; Mon, 01 Aug 2011 11:40:38 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:33772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnubd-0006bU-Dp for qemu-devel@nongnu.org; Mon, 01 Aug 2011 11:40:37 -0400 Received: by yxt3 with SMTP id 3so3942719yxt.4 for ; Mon, 01 Aug 2011 08:40:36 -0700 (PDT) Message-ID: <4E36C8F2.1000004@codemonkey.ws> Date: Mon, 01 Aug 2011 10:40:34 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1312208590-25502-1-git-send-email-aliguori@us.ibm.com> <1312208590-25502-7-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/12] char: add an edge event API for the front ends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Amit Shah , Hans de Goede , Anthony Liguori , qemu-devel@nongnu.org On 08/01/2011 10:39 AM, Stefan Hajnoczi wrote: > On Mon, Aug 1, 2011 at 3:23 PM, Anthony Liguori wrote: >> Signed-off-by: Anthony Liguori >> --- >> 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. Ack. I thought the same thing to myself, meant to rename it, and then promptly forgot to :-) Regards, Anthony Liguori > > Stefan >