test: dm: virtio: Test notify before del_vqs
authorAndrew Scull <ascull@google.com>
Mon, 16 May 2022 10:41:35 +0000 (10:41 +0000)
committerTom Rini <trini@konsulko.com>
Wed, 8 Jun 2022 13:24:04 +0000 (09:24 -0400)
The virtqueue is passed to virtio_notify() so move the virtqueue
deletion to the end of the test when it's no longer needed. This wasn't
causing any problems because the sandbox virtio transport driver doesn't
do anything for notifications, but it could cause problems if things
change and it was a bad example.

Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/dm/virtio.c

index aa4e3d7..ff1dea3 100644 (file)
@@ -80,8 +80,8 @@ static int dm_test_virtio_all_ops(struct unit_test_state *uts)
        ut_asserteq_64(BIT_ULL(VIRTIO_F_VERSION_1), features);
        ut_assertok(virtio_set_features(dev));
        ut_assertok(virtio_find_vqs(dev, nvqs, vqs));
-       ut_assertok(virtio_del_vqs(dev));
        ut_assertok(virtio_notify(dev, vqs[0]));
+       ut_assertok(virtio_del_vqs(dev));
 
        return 0;
 }