From f2fb0b387032601db3f6dd37da1e7c7992dd1a37 Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 6 Dec 2007 01:18:46 +0000 Subject: [PATCH] mutex_init: use 'if' instead of 'switch' to avoid complaints from the compiler. --- sys/kern/kern_mutex.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 250a474e6769..cbc035777dfa 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_mutex.c,v 1.25 2007/12/05 06:50:07 ad Exp $ */ +/* $NetBSD: kern_mutex.c,v 1.26 2007/12/06 01:18:46 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ #define __MUTEX_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.25 2007/12/05 06:50:07 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.26 2007/12/06 01:18:46 ad Exp $"); #include "opt_multiprocessor.h" @@ -333,17 +333,12 @@ mutex_init(kmutex_t *mtx, kmutex_type_t type, int ipl) break; case MUTEX_DEFAULT: case MUTEX_DRIVER: - switch (ipl) { - case IPL_NONE: - case IPL_SOFTCLOCK: - case IPL_SOFTBIO: - case IPL_SOFTNET: - case IPL_SOFTSERIAL: + if (ipl == IPL_NONE || ipl == IPL_SOFTCLOCK || + ipl == IPL_SOFTBIO || ipl == IPL_SOFTNET || + ipl == IPL_SOFTSERIAL) { type = MUTEX_ADAPTIVE; - break; - default: + } else { type = MUTEX_SPIN; - break; } break; default: