Received: from eggs.gnu.org ([2001:4830:134:3::10]:51527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8fIL-00067f-Bm for qemu-devel@nongnu.org; Sun, 20 Nov 2016 22:29:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8fIK-0003dj-CV for qemu-devel@nongnu.org; Sun, 20 Nov 2016 22:29:25 -0500 Date: Mon, 21 Nov 2016 13:30:28 +1100 From: David Gibson Message-ID: <20161121023028.GE18153@umbus.fritz.box> References: <1479460177-9362-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KlAEzMkarCnErv5Q" Content-Disposition: inline In-Reply-To: <1479460177-9362-1-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH] hw/char/spapr_vty: Return amount of free buffer entries in vty_can_receive() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org --KlAEzMkarCnErv5Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 18, 2016 at 10:09:37AM +0100, Thomas Huth wrote: > The can_receive() callbacks of the character devices should return > the amount of characters that can be accepted at once, not just a > boolean value (which rather means only one character at a time). >=20 > Signed-off-by: Thomas Huth Applied to ppc-for-2.8, thanks. > --- > hw/char/spapr_vty.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c > index 06b9b39..7c22b8b 100644 > --- a/hw/char/spapr_vty.c > +++ b/hw/char/spapr_vty.c > @@ -25,7 +25,7 @@ static int vty_can_receive(void *opaque) > { > VIOsPAPRVTYDevice *dev =3D VIO_SPAPR_VTY_DEVICE(opaque); > =20 > - return (dev->in - dev->out) < VTERM_BUFSIZE; > + return VTERM_BUFSIZE - (dev->in - dev->out); > } > =20 > static void vty_receive(void *opaque, const uint8_t *buf, int size) --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --KlAEzMkarCnErv5Q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYMlxCAAoJEGw4ysog2bOSAIsQAJHPf/5RZvW/fWnvg68qcVfe tjgIivEwddXGdNKrUyKuiC+pB3q1QaJ2D/WJhnDfq/q4+jT6BkMwuqLlei6OWqI3 NWEYDz47Z24ZB++nsCFZ+rjdEvYnQQYuzVUNFsU9fA7FQuepJVaX6jV7WUncnuIj trl1sMONsGaQaBT2PszASD8IxelFpRtYkQlmeKJwaWfNFJmDkDlzMQYrPIqMbOQ0 3sRoAMkmmtherzBGdIYt7BpjiEKaRdrmCLycXihgNL98TD2URkzeRqRjTu6tumSm 9LYaYTLy1xUblI/xKXF4CB+vL+bmk4Ae1IoA7Xh5F2r9a1GjMT1SMrpMrtReG7k/ yGE2LojyUsybYwAFTmPSso0IGkKM8hSJi/kcGoKv4A0oEgvJKD9a6b8gfMlmvf4b FkOeA0DmvHs/cXgeVHPKGBEH1XgLGPU1S4ZJtzlB15Ut1orJFjLjXSnEnGk7kMQ7 jGgXK2YnYRdmc5z6za8ItaMGUxWwRZD5y7yNKypf5g8GMdAilFRGU3eHg/K7jnus 4XOVO3+p68G1OsjKnsbJaQp1CE/x9HrFIgRSM45WlXlyfBF0ojdOGMQRFAQdlLRT SRO4xQbgAtSbZx/o1+en745p71kciS3T3ZaTuMnwO2Be49aVvmGSyHinp9AQfjHz p5HXT65Uc4LuIlZj4jNW =xUs4 -----END PGP SIGNATURE----- --KlAEzMkarCnErv5Q--