Skip to content

Commit

Permalink
libkern: don't use MPASS
Browse files Browse the repository at this point in the history
Using MPASS in libkern breaks buildworld.  Replace MPASS with KASSERT
in three places.

(cherry picked from commit 08f6f78f81e21b21dd002a9389436b0333cb3488)
  • Loading branch information
Doug Moore authored and fichtner committed Feb 18, 2025
1 parent 5e66087 commit 0f5c5ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/sys/libkern.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,23 @@ static __inline __pure2 int
ilog2_int(int n)
{

MPASS(n != 0);
KASSERT(n != 0, ("ilog argument must be nonzero"));
return (8 * sizeof(n) - 1 - __builtin_clz((u_int)n));
}

static __inline __pure2 int
ilog2_long(long n)
{

MPASS(n != 0);
KASSERT(n != 0, ("ilog argument must be nonzero"));
return (8 * sizeof(n) - 1 - __builtin_clzl((u_long)n));
}

static __inline __pure2 int
ilog2_long_long(long long n)
{

MPASS(n != 0);
KASSERT(n != 0, ("ilog argument must be nonzero"));
return (8 * sizeof(n) - 1 -
__builtin_clzll((unsigned long long)n));
}
Expand Down

0 comments on commit 0f5c5ae

Please sign in to comment.