]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
libxl_usb: Fix wrong usage of asserts
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 13 Jun 2019 11:20:31 +0000 (12:20 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 20 Sep 2019 09:41:01 +0000 (10:41 +0100)
Replace the assert(0) by abort() since the intention in libxl is that
asserts are always compiled in. This patch makes its clear and removes
the need to deal with asserts been compiled out.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_usb.c

index 3d389c019822b6c31ad952c204834ec316e0faa2..9f72857d87af26e8fb54d2d11392424480d966c5 100644 (file)
@@ -147,8 +147,7 @@ static int libxl__device_from_usbctrl(libxl__gc *gc, uint32_t domid,
         device->backend_kind = LIBXL__DEVICE_KIND_NONE;
         break;
     default:
-        assert(0); /* can't really happen. */
-        break;
+        abort(); /* can't really happen. */
     }
     device->devid           = usbctrl->devid;
     device->domid           = domid;
@@ -370,8 +369,7 @@ static int libxl__device_usbctrl_add_hvm(libxl__gc *gc, uint32_t domid,
         flexarray_append_pair(qmp_args, "p3", GCSPRINTF("%d", usbctrl->ports));
         break;
     default:
-        assert(0); /* Should not be possible. */
-        break;
+        abort(); /* Should not be possible. */
     }
 
     flexarray_append_pair(qmp_args, "id",