Fix build of DTrace with GCC 4.8

Use __diagused for a variable which is only referred by KASSERT.

Advised by matt@
This commit is contained in:
ozaki-r 2014-03-07 02:37:16 +00:00
parent 16d5017a4b
commit e9ddbe399c
1 changed files with 2 additions and 3 deletions

View File

@ -16655,7 +16655,7 @@ dtrace_state_worker_add(void (*fn)(dtrace_state_t *), dtrace_state_t *state,
hrtime_t interval)
{
struct dtrace_state_worker *w;
int error;
int error __diagused;
w = kmem_alloc(sizeof(*w), KM_SLEEP);
mutex_init(&w->lock, MUTEX_DEFAULT, IPL_NONE);
@ -16666,7 +16666,6 @@ dtrace_state_worker_add(void (*fn)(dtrace_state_t *), dtrace_state_t *state,
w->exiting = false;
error = kthread_create(PRI_NONE, KTHREAD_MPSAFE|KTHREAD_MUSTJOIN, NULL,
dtrace_state_worker_thread, w, &w->lwp, "dtrace-state-worker");
(void) error;
KASSERT(error == 0); /* XXX */
return w;
}
@ -16674,7 +16673,7 @@ dtrace_state_worker_add(void (*fn)(dtrace_state_t *), dtrace_state_t *state,
void
dtrace_state_worker_remove(struct dtrace_state_worker *w)
{
int error;
int error __diagused;
KASSERT(!w->exiting);
mutex_enter(&w->lock);