mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 23:28:58 +00:00
In order to eliminate a branch, convert opcode to unsigned integer.
This commit is contained in:
parent
91d0b4d615
commit
7c24ae418a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163678
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue