Print this page
5255 uts shouldn't open-code ISP2
@@ -463,11 +463,11 @@
* next power of two larger than ra_limit.
*/
ASSERT(ra_limit != 0);
- kpm_size_shift = (ra_limit & (ra_limit - 1)) != 0 ?
+ kpm_size_shift = !ISP2(ra_limit) ?
highbit(ra_limit) : highbit(ra_limit) - 1;
/*
* No virtual caches on sun4v so size matches size shift
*/
@@ -848,11 +848,11 @@
entries = 1 << entries;
}
entries = MIN(entries, max_entries);
/* If not a power of 2, truncate to a power of 2. */
- if ((entries & (entries - 1)) != 0) {
+ if (!ISP2(entries)) {
entries = 1 << (highbit(entries) - 1);
}
return (entries);
}