diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2017-08-10 13:00:10 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2017-08-10 13:00:10 +0000 |
| commit | 4ef8a6301fb73f38c3aec05d88ede98400ed04f6 (patch) | |
| tree | 7c908ab77fa2f04ac48165fcdec8d69fa07b6b63 | |
| parent | 8ea44415987253c8efd47ea2cc6e28238b0b8816 (diff) | |
Notes
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/wait.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h index c04a79092c6a..ea4586f2e2ea 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait.h +++ b/sys/compat/linuxkpi/common/include/linux/wait.h @@ -127,16 +127,14 @@ int linux_wait_event_common(wait_queue_head_t *, wait_queue_t *, int, */ #define __wait_event_common(wqh, cond, timeout, state, lock) ({ \ DEFINE_WAIT(__wq); \ - const int __timeout = (timeout) < 1 ? 1 : (timeout); \ + const int __timeout = ((int)(timeout)) < 1 ? 1 : (timeout); \ int __start = ticks; \ int __ret = 0; \ \ for (;;) { \ linux_prepare_to_wait(&(wqh), &__wq, state); \ - if (cond) { \ - __ret = 1; \ + if (cond) \ break; \ - } \ __ret = linux_wait_event_common(&(wqh), &__wq, \ __timeout, state, lock); \ if (__ret != 0) \ @@ -158,10 +156,10 @@ int linux_wait_event_common(wait_queue_head_t *, wait_queue_t *, int, __ret; \ }) -#define wait_event(wqh, cond) ({ \ - __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \ +#define wait_event(wqh, cond) do { \ + (void) __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \ TASK_UNINTERRUPTIBLE, NULL); \ -}) +} while (0) #define wait_event_timeout(wqh, cond, timeout) ({ \ __wait_event_common(wqh, cond, timeout, TASK_UNINTERRUPTIBLE, \ |
