From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRejb-0001Hz-GB for qemu-devel@nongnu.org; Fri, 05 Feb 2016 06:39:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRejX-0004hQ-Fj for qemu-devel@nongnu.org; Fri, 05 Feb 2016 06:39:31 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:52888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRejX-0004gT-5I for qemu-devel@nongnu.org; Fri, 05 Feb 2016 06:39:27 -0500 Received: from localhost by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 5 Feb 2016 11:39:25 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2A59B1B0805F for ; Fri, 5 Feb 2016 11:39:34 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u15BdMPW3736026 for ; Fri, 5 Feb 2016 11:39:22 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u15BdMC5006509 for ; Fri, 5 Feb 2016 06:39:22 -0500 Date: Fri, 5 Feb 2016 12:39:20 +0100 From: Cornelia Huck Message-ID: <20160205123920.648985de.cornelia.huck@de.ibm.com> In-Reply-To: <20160205104559.21017.3686.stgit@bahia.huguette.org> References: <20160205103927.21017.26364.stgit@bahia.huguette.org> <20160205104559.21017.3686.stgit@bahia.huguette.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 5/6] vhost: simplify vhost_needs_vring_endian() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Laurent Vivier , qemu-devel@nongnu.org, "Michael S. Tsirkin" On Fri, 05 Feb 2016 11:46:04 +0100 Greg Kurz wrote: > After the call to virtio_vdev_has_feature(), we only care for legacy > devices, so we don't need the extra check in virtio_is_big_endian(). > > Also the device_endian field is always set (VIRTIO_DEVICE_ENDIAN_UNKNOWN > may only happen on a virtio_load() path that cannot lead here), so we > don't need the assert() either. > > This open codes the device_endian checking in vhost_needs_vring_endian(). > It also adds a comment to explain the logic, as recent reviews showed the > cross-endian tweaks aren't that obvious. > > Signed-off-by: Greg Kurz > --- > hw/virtio/vhost.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Reviewed-by: Cornelia Huck