Print this page
5255 uts shouldn't open-code ISP2
@@ -31,10 +31,11 @@
* ModifyQP() verb. This includes all the code for legal
* transitions to and from Reset, Init, RTR, RTS, SQD, SQErr,
* and Error.
*/
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
#include <sys/modctl.h>
@@ -3373,11 +3374,11 @@
* Then find the next highest power-of-2
*/
if (rdma_ra_in == 0) {
rdma_ra_in = 1;
}
- if ((rdma_ra_in & (rdma_ra_in - 1)) == 0) {
+ if (ISP2(rdma_ra_in)) {
*rra_max = highbit(rdma_ra_in) - 1;
} else {
*rra_max = highbit(rdma_ra_in);
}
return (DDI_SUCCESS);
@@ -3409,11 +3410,11 @@
* Then find the next highest power-of-2
*/
if (rdma_ra_out == 0) {
rdma_ra_out = 1;
}
- if ((rdma_ra_out & (rdma_ra_out - 1)) == 0) {
+ if (ISP2(rdma_ra_out)) {
*sra_max = highbit(rdma_ra_out) - 1;
} else {
*sra_max = highbit(rdma_ra_out);
}
return (DDI_SUCCESS);