From 663180310555bd327d139fb2cd11318607a7f247 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 12 Sep 2014 13:20:40 +0200 Subject: [PATCH] usb/hcd: asserts should not have side effects They can be deactivated with -DNDEBUG, which is why they can't contain code which should always be run. It seems the local implementation of USB_ASSERT doesn't honor the CPP flags NDEBUG, this will be corrected in a later patch. Change-Id: Iac56b09fd563f1b8c4c7be15a468a05b9cc86a18 --- minix/drivers/usb/usbd/hcd/hcd_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/minix/drivers/usb/usbd/hcd/hcd_common.c b/minix/drivers/usb/usbd/hcd/hcd_common.c index d6b6f798c..03aa998eb 100644 --- a/minix/drivers/usb/usbd/hcd/hcd_common.c +++ b/minix/drivers/usb/usbd/hcd/hcd_common.c @@ -180,6 +180,7 @@ void hcd_os_nanosleep(int nanosec) { struct timespec nanotm; + int r; DEBUG_DUMP; @@ -194,8 +195,8 @@ hcd_os_nanosleep(int nanosec) /* TODO: Since it is not likely to be ever interrupted, we do not try * to sleep for a remaining time in case of signal handling */ /* Signal handling will most likely end up with termination anyway */ - USB_ASSERT(EXIT_SUCCESS == nanosleep(&nanotm, NULL), - "Calling nanosleep() failed"); + r = nanosleep(&nanotm, NULL); + USB_ASSERT(EXIT_SUCCESS == r, "Calling nanosleep() failed"); }