[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] libxl_usb: Fix wrong usage of asserts
commit 0fa2525b81c0f9065e4a90e458a5b0c014daa05a Author: Anthony PERARD <anthony.perard@xxxxxxxxxx> AuthorDate: Thu Jun 13 12:20:31 2019 +0100 Commit: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> CommitDate: Fri Sep 20 10:41:01 2019 +0100 libxl_usb: Fix wrong usage of asserts 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@xxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- tools/libxl/libxl_usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl_usb.c b/tools/libxl/libxl_usb.c index 3d389c0198..9f72857d87 100644 --- a/tools/libxl/libxl_usb.c +++ b/tools/libxl/libxl_usb.c @@ -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", -- generated by git-patchbot for /home/xen/git/xen.git#staging _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |