diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-10-25 06:38:46 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-10-25 06:38:46 +0000 |
commit | c7a2917f38afc6dc5c4a7b482b5c2cb4600b7e6f (patch) | |
tree | af5bf2b0605f3161e6c24fa4cb6bf6a55ddee52a /sys/kern/kern_umtx.c | |
parent | 6f6aaf471b500472d002dc0b68cd211862a1afad (diff) | |
download | FreeBSD-src-c7a2917f38afc6dc5c4a7b482b5c2cb4600b7e6f.zip FreeBSD-src-c7a2917f38afc6dc5c4a7b482b5c2cb4600b7e6f.tar.gz |
In order to eliminate a branch, convert opcode to unsigned integer.
Diffstat (limited to 'sys/kern/kern_umtx.c')
-rw-r--r-- | sys/kern/kern_umtx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index dfb01a0..5ca17c0 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2291,7 +2291,7 @@ static _umtx_op_func op_table[] = { int _umtx_op(struct thread *td, struct _umtx_op_args *uap) { - if (uap->op >= 0 && uap->op < UMTX_OP_MAX) + if ((unsigned)uap->op < UMTX_OP_MAX) return (*op_table[uap->op])(td, uap); return (EINVAL); } @@ -2414,7 +2414,7 @@ static _umtx_op_func op_table_compat32[] = { int freebsd32_umtx_op(struct thread *td, struct freebsd32_umtx_op_args *uap) { - if (uap->op >= 0 && uap->op < UMTX_OP_MAX) + if ((unsigned)uap->op < UMTX_OP_MAX) return (*op_table_compat32[uap->op])(td, (struct _umtx_op_args *)uap); return (EINVAL); |