Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756059AbaJWQU7 (ORCPT ); Thu, 23 Oct 2014 12:20:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61489 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753144AbaJWQU4 (ORCPT ); Thu, 23 Oct 2014 12:20:56 -0400 Date: Thu, 23 Oct 2014 19:24:28 +0300 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Rusty Russell , virtualization@lists.linux-foundation.org Subject: [PATCH RFC v4 06/17] virtio: make endian-ness depend on virtio 1.0 Message-ID: <1414081380-14623-7-git-send-email-mst@redhat.com> References: <1414081380-14623-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1414081380-14623-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org virtio 1.0 is LE, virtio without 1.0 is native endian. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 4bc2ebe..952b6d7 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -157,11 +157,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu) #define DEFINE_VIRTIO_XX_TO_CPU(bits) \ static inline u##bits virtio##bits##_to_cpu(struct virtio_device *vdev, __virtio##bits val) \ { \ - return __virtio##bits##_to_cpu(false, val); \ + return __virtio##bits##_to_cpu(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } \ static inline __virtio##bits cpu_to_virtio##bits(struct virtio_device *vdev, u##bits val) \ { \ - return __cpu_to_virtio##bits(false, val); \ + return __cpu_to_virtio##bits(virtio_has_feature(vdev, VIRTIO_F_VERSION_1), val); \ } static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) -- MST -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/