Re: [PATCH v5 1/8] virtio: introduce virtio_is_little_endian() helper

From: Thomas Huth
Date: Thu Apr 23 2015 - 13:22:40 EST


Am Thu, 23 Apr 2015 17:26:20 +0200
schrieb Greg Kurz <gkurz@xxxxxxxxxxxxxxxxxx>:

> Signed-off-by: Greg Kurz <gkurz@xxxxxxxxxxxxxxxxxx>
> ---
> include/linux/virtio_config.h | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
> index ca3ed78..bd1a582 100644
> --- a/include/linux/virtio_config.h
> +++ b/include/linux/virtio_config.h
> @@ -205,35 +205,40 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
> return 0;
> }
>
> +static inline bool virtio_is_little_endian(struct virtio_device *vdev)
> +{
> + return virtio_has_feature(vdev, VIRTIO_F_VERSION_1);
> +}

So this function returns false when _not_ using version 1, but running
on a little endian host + guest? Sounds confusing. Maybe you could name
it "virtio_is_v1()" or so instead?

Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/