diff mbox

[v3,1/5] vhost-user-test: fix features mask

Message ID 20171221212125.19075-2-maxime.coquelin@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maxime Coquelin Dec. 21, 2017, 9:21 p.m. UTC
VIRTIO_NET_F_MAC is a bit position, not a bit mask.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 tests/vhost-user-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marc-André Lureau Dec. 22, 2017, 1:41 p.m. UTC | #1
On Thu, Dec 21, 2017 at 10:21 PM, Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
> VIRTIO_NET_F_MAC is a bit position, not a bit mask.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  tests/vhost-user-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> index e2c89ed376..43c6528644 100644
> --- a/tests/vhost-user-test.c
> +++ b/tests/vhost-user-test.c
> @@ -177,7 +177,7 @@ static void init_virtio_dev(TestServer *s)
>      qvirtio_set_driver(&dev->vdev);
>
>      features = qvirtio_get_features(&dev->vdev);
> -    features = features & VIRTIO_NET_F_MAC;
> +    features = features & (1u << VIRTIO_NET_F_MAC);
>      qvirtio_set_features(&dev->vdev, features);
>
>      qvirtio_set_driver_ok(&dev->vdev);
> --
> 2.14.3
>
>
diff mbox

Patch

diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index e2c89ed376..43c6528644 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -177,7 +177,7 @@  static void init_virtio_dev(TestServer *s)
     qvirtio_set_driver(&dev->vdev);
 
     features = qvirtio_get_features(&dev->vdev);
-    features = features & VIRTIO_NET_F_MAC;
+    features = features & (1u << VIRTIO_NET_F_MAC);
     qvirtio_set_features(&dev->vdev, features);
 
     qvirtio_set_driver_ok(&dev->vdev);