]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
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 aa4e3d778e8bea930f22408d693b6dd5f69a8446..ff1dea323cf1785dd2aeb6a7715920f43b422df9 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;
 }