--- old/usr/src/uts/common/dtrace/dtrace.c	2014-10-23 10:42:09.225001092 -0400
+++ new/usr/src/uts/common/dtrace/dtrace.c	2014-10-23 10:42:09.232093910 -0400
@@ -13039,7 +13039,7 @@
 		if (!(sec->dofs_flags & DOF_SECF_LOAD))
 			continue; /* just ignore non-loadable sections */
 
-		if (sec->dofs_align & (sec->dofs_align - 1)) {
+		if (!ISP2(sec->dofs_align)) {
 			dtrace_dof_error(dof, "bad section alignment");
 			return (-1);
 		}
--- old/usr/src/uts/common/dtrace/fasttrap.c	2014-10-23 10:42:09.859977121 -0400
+++ new/usr/src/uts/common/dtrace/fasttrap.c	2014-10-23 10:42:09.864830542 -0400
@@ -2156,7 +2156,7 @@
 	if (nent == 0 || nent > 0x1000000)
 		nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
 
-	if ((nent & (nent - 1)) == 0)
+	if (ISP2(nent))
 		fasttrap_tpoints.fth_nent = nent;
 	else
 		fasttrap_tpoints.fth_nent = 1 << fasttrap_highbit(nent);
@@ -2169,7 +2169,7 @@
 	 * ... and the providers hash table...
 	 */
 	nent = FASTTRAP_PROVIDERS_DEFAULT_SIZE;
-	if ((nent & (nent - 1)) == 0)
+	if (ISP2(nent))
 		fasttrap_provs.fth_nent = nent;
 	else
 		fasttrap_provs.fth_nent = 1 << fasttrap_highbit(nent);
@@ -2182,7 +2182,7 @@
 	 * ... and the procs hash table.
 	 */
 	nent = FASTTRAP_PROCS_DEFAULT_SIZE;
-	if ((nent & (nent - 1)) == 0)
+	if (ISP2(nent))
 		fasttrap_procs.fth_nent = nent;
 	else
 		fasttrap_procs.fth_nent = 1 << fasttrap_highbit(nent);
--- old/usr/src/uts/common/fs/dcfs/dc_vnops.c	2014-10-23 10:42:10.074677095 -0400
+++ new/usr/src/uts/common/fs/dcfs/dc_vnops.c	2014-10-23 10:42:10.079527735 -0400
@@ -948,8 +948,7 @@
 	if (error || hdr->ch_magic != CH_MAGIC_ZLIB ||
 	    hdr->ch_version != CH_VERSION || hdr->ch_algorithm != CH_ALG_ZLIB ||
 	    hdr->ch_fsize == 0 || hdr->ch_blksize < PAGESIZE ||
-	    hdr->ch_blksize > ptob(DCCACHESIZE) ||
-	    (hdr->ch_blksize & (hdr->ch_blksize - 1)) != 0)
+	    hdr->ch_blksize > ptob(DCCACHESIZE) || !ISP2(hdr->ch_blksize))
 		return (NULL);
 
 	/* get underlying file size */
--- old/usr/src/uts/common/fs/zfs/zio.c	2014-10-23 10:42:10.262562167 -0400
+++ new/usr/src/uts/common/fs/zfs/zio.c	2014-10-23 10:42:10.269203152 -0400
@@ -24,6 +24,7 @@
  * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/zfs_context.h>
 #include <sys/fm/fs/zfs.h>
 #include <sys/spa.h>
@@ -119,7 +120,7 @@
 		size_t align = 0;
 		size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0;
 
-		while (p2 & (p2 - 1))
+		while (!ISP2(p2))
 			p2 &= p2 - 1;
 
 #ifndef _KERNEL
--- old/usr/src/uts/common/inet/ilb/ilb.c	2014-10-23 10:42:10.533900497 -0400
+++ new/usr/src/uts/common/inet/ilb/ilb.c	2014-10-23 10:42:10.538792756 -0400
@@ -24,6 +24,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/kmem.h>
 #include <sys/ksynch.h>
 #include <sys/systm.h>
@@ -284,7 +285,7 @@
 	 * If ilbs->ilbs_rule_hash_size is not a power of 2, bump it up to
 	 * the next power of 2.
 	 */
-	if (ilbs->ilbs_rule_hash_size & (ilbs->ilbs_rule_hash_size - 1)) {
+	if (!ISP2(ilbs->ilbs_rule_hash_size)) {
 		for (i = 0; i < 31; i++) {
 			if (ilbs->ilbs_rule_hash_size < (1 << i))
 				break;
--- old/usr/src/uts/common/inet/ilb/ilb_conn.c	2014-10-23 10:42:10.743069586 -0400
+++ new/usr/src/uts/common/inet/ilb/ilb_conn.c	2014-10-23 10:42:10.747920251 -0400
@@ -24,6 +24,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/time.h>
@@ -300,7 +301,7 @@
 	 * If ilbs->ilbs_conn_hash_size is not a power of 2, bump it up to
 	 * the next power of 2.
 	 */
-	if (ilbs->ilbs_conn_hash_size & (ilbs->ilbs_conn_hash_size - 1)) {
+	if (!ISP2(ilbs->ilbs_conn_hash_size)) {
 		for (i = 0; i < 31; i++) {
 			if (ilbs->ilbs_conn_hash_size < (1 << i))
 				break;
@@ -1359,7 +1360,7 @@
 	char tq_name[TASKQ_NAMELEN];
 	ilb_timer_t *tm;
 
-	if (ilbs->ilbs_sticky_hash_size & (ilbs->ilbs_sticky_hash_size - 1)) {
+	if (!ISP2(ilbs->ilbs_sticky_hash_size)) {
 		for (i = 0; i < 31; i++) {
 			if (ilbs->ilbs_sticky_hash_size < (1 << i))
 				break;
--- old/usr/src/uts/common/inet/sctp/sctp_hash.c	2014-10-23 10:42:10.935896557 -0400
+++ new/usr/src/uts/common/inet/sctp/sctp_hash.c	2014-10-23 10:42:10.940844092 -0400
@@ -23,6 +23,7 @@
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/socket.h>
 #include <sys/ddi.h>
 #include <sys/sunddi.h>
@@ -66,7 +67,7 @@
 	/* Start with /etc/system value */
 	sctps->sctps_conn_hash_size = sctp_conn_hash_size;
 
-	if (sctps->sctps_conn_hash_size & (sctps->sctps_conn_hash_size - 1)) {
+	if (!ISP2(sctps->sctps_conn_hash_size)) {
 		/* Not a power of two. Round up to nearest power of two */
 		for (i = 0; i < 31; i++) {
 			if (sctps->sctps_conn_hash_size < (1 << i))
--- old/usr/src/uts/common/inet/udp/udp.c	2014-10-23 10:42:11.107296412 -0400
+++ new/usr/src/uts/common/inet/udp/udp.c	2014-10-23 10:42:11.112816420 -0400
@@ -25,6 +25,7 @@
  */
 /* Copyright (c) 1990 Mentat Inc. */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/stream.h>
 #include <sys/stropts.h>
@@ -4384,7 +4385,7 @@
 	us->us_bind_fanout_size = udp_bind_fanout_size;
 
 	/* Roundup variable that might have been modified in /etc/system */
-	if (us->us_bind_fanout_size & (us->us_bind_fanout_size - 1)) {
+	if (!ISP2(us->us_bind_fanout_size)) {
 		/* Not a power of two. Round up to nearest power of two */
 		for (i = 0; i < 31; i++) {
 			if (us->us_bind_fanout_size < (1 << i))
--- old/usr/src/uts/common/io/1394/t1394.c	2014-10-23 10:42:11.489561567 -0400
+++ new/usr/src/uts/common/io/1394/t1394.c	2014-10-23 10:42:11.494602183 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * t1394.c
  *    1394 Target Driver Interface
@@ -32,6 +30,7 @@
  *    by target drivers
  */
 
+#include <sys/sysmacros.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
 #include <sys/sunddi.h>
@@ -1909,7 +1908,7 @@
 	temp = props->cec_channel_mask;
 	if (props->cec_options & T1394_NO_IRM_ALLOC) {
 		/* If T1394_NO_IRM_ALLOC, then only one bit should be set */
-		if ((temp & (temp - 1)) != 0) {
+		if (!ISP2(temp)) {
 			TNF_PROBE_1(t1394_alloc_isoch_cec_error,
 			    S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg,
 			    "Invalid channel mask");
--- old/usr/src/uts/common/io/arn/arn_main.c	2014-10-23 10:42:11.754304652 -0400
+++ new/usr/src/uts/common/io/arn/arn_main.c	2014-10-23 10:42:11.759235124 -0400
@@ -19,6 +19,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/signal.h>
@@ -2645,12 +2646,8 @@
 
 	/* set up supported mcs set */
 	(void) memset(&ht_info->rx_mcs_mask, 0, sizeof (ht_info->rx_mcs_mask));
-	tx_streams =
-	    !(sc->sc_ah->ah_caps.tx_chainmask &
-	    (sc->sc_ah->ah_caps.tx_chainmask - 1)) ? 1 : 2;
-	rx_streams =
-	    !(sc->sc_ah->ah_caps.rx_chainmask &
-	    (sc->sc_ah->ah_caps.rx_chainmask - 1)) ? 1 : 2;
+	tx_streams = ISP2(sc->sc_ah->ah_caps.tx_chainmask) ? 1 : 2;
+	rx_streams = ISP2(sc->sc_ah->ah_caps.rx_chainmask) ? 1 : 2;
 
 	ht_info->rx_mcs_mask[0] = 0xff;
 	if (rx_streams >= 2)
--- old/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c	2014-10-23 10:42:12.013731404 -0400
+++ new/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c	2014-10-23 10:42:12.018841294 -0400
@@ -25,6 +25,7 @@
  * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/conf.h>
 #include <sys/file.h>
 #include <sys/ddi.h>
@@ -1836,7 +1837,7 @@
 		sl->sl_flags |= SL_WRITE_PROTECTED;
 	}
 	if (slu->slu_blksize_valid) {
-		if ((slu->slu_blksize & (slu->slu_blksize - 1)) ||
+		if (!ISP2(slu->slu_blksize) ||
 		    (slu->slu_blksize > (32 * 1024)) ||
 		    (slu->slu_blksize == 0)) {
 			*err_ret = SBD_RET_INVALID_BLKSIZE;
--- old/usr/src/uts/common/io/comstar/port/fct/discovery.c	2014-10-23 10:42:12.293611057 -0400
+++ new/usr/src/uts/common/io/comstar/port/fct/discovery.c	2014-10-23 10:42:12.300439904 -0400
@@ -22,6 +22,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/conf.h>
 #include <sys/file.h>
 #include <sys/ddi.h>
@@ -219,7 +220,7 @@
 		(void) strcpy(topology, topologies[li->port_topology]);
 	}
 
-	if ((s == 0) || ((s & 0xf00) != 0) || ((s & (s - 1)) != 0)) {
+	if ((s == 0) || ((s & 0xf00) != 0) || !ISP2(s)) {
 		speed[0] = '?';
 	} else if (s == PORT_SPEED_10G) {
 		speed[0] = '1';
--- old/usr/src/uts/common/io/drm/drmP.h	2014-10-23 10:42:12.551622050 -0400
+++ new/usr/src/uts/common/io/drm/drmP.h	2014-10-23 10:42:12.556460763 -0400
@@ -41,6 +41,7 @@
 #ifndef	_DRMP_H
 #define	_DRMP_H
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/modctl.h>
@@ -326,9 +327,6 @@
 
 #define	__OS_HAS_AGP	1
 
-#define	__offsetof(type, field) ((size_t)(&((type *)0)->field))
-#define	offsetof(type, field)   __offsetof(type, field)
-
 typedef struct drm_pci_id_list
 {
 	int vendor;
--- old/usr/src/uts/common/io/ib/adapters/hermon/hermon_cfg.c	2014-10-23 10:42:12.726360869 -0400
+++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_cfg.c	2014-10-23 10:42:12.731357050 -0400
@@ -31,6 +31,7 @@
  *    down the list of Hermon configuration information.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -437,7 +438,7 @@
 	 */
 	max_size = (HERMON_QP_WQE_MLX_QP1_HDRS + (max_sgl << 4));
 	log2 = highbit(max_size);
-	if ((max_size & (max_size - 1)) == 0) {
+	if (ISP2(max_size)) {
 		log2 = log2 - 1;
 	}
 	max_size = (1 << log2);
--- old/usr/src/uts/common/io/ib/adapters/hermon/hermon_qp.c	2014-10-23 10:42:12.886666812 -0400
+++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_qp.c	2014-10-23 10:42:12.891791610 -0400
@@ -404,13 +404,12 @@
 	 */
 	log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes);
 	/* if the total is a power of two, reduce it */
-	if (((attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes)  &
-	    (attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes - 1)) == 0)	{
+	if (ISP2(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes))	{
 		log_qp_sq_size = log_qp_sq_size - 1;
 	}
 
 	log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
-	if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_rq)) {
 		log_qp_rq_size = log_qp_rq_size - 1;
 	}
 
@@ -921,11 +920,11 @@
 	attr_p->qp_sizes.cs_rq =
 	    max(attr_p->qp_sizes.cs_rq, HERMON_QP_MIN_SIZE);
 	log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
-	if ((attr_p->qp_sizes.cs_sq & (attr_p->qp_sizes.cs_sq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_sq)) {
 		log_qp_sq_size = log_qp_sq_size - 1;
 	}
 	log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
-	if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_rq)) {
 		log_qp_rq_size = log_qp_rq_size - 1;
 	}
 
@@ -1521,13 +1520,12 @@
 	 */
 	log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes);
 	/* if the total is a power of two, reduce it */
-	if (((attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes)  &
-	    (attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes - 1)) == 0)	{
+	if (ISP2(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes))	{
 		log_qp_sq_size = log_qp_sq_size - 1;
 	}
 
 	log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
-	if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_rq)) {
 		log_qp_rq_size = log_qp_rq_size - 1;
 	}
 
@@ -2831,7 +2829,7 @@
 		 */
 		max_size = (HERMON_QP_WQE_MLX_SND_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2851,7 +2849,7 @@
 		 */
 		max_size = (HERMON_QP_WQE_MLX_SND_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2868,7 +2866,7 @@
 		 */
 		max_size = (HERMON_QP_WQE_MLX_RCV_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2888,7 +2886,7 @@
 		 */
 		max_size = (HERMON_QP_WQE_MLX_QP0_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2910,7 +2908,7 @@
 		 */
 		max_size = (HERMON_QP_WQE_MLX_QP1_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
--- old/usr/src/uts/common/io/ib/adapters/hermon/hermon_qpmod.c	2014-10-23 10:42:13.130072204 -0400
+++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_qpmod.c	2014-10-23 10:42:13.135083681 -0400
@@ -33,6 +33,7 @@
  *    and Error.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -3375,7 +3376,7 @@
 	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);
@@ -3411,7 +3412,7 @@
 	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);
--- old/usr/src/uts/common/io/ib/adapters/hermon/hermon_rsrc.c	2014-10-23 10:42:13.426541396 -0400
+++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_rsrc.c	2014-10-23 10:42:13.433325431 -0400
@@ -32,6 +32,7 @@
  *    by Hermon hardware or which live in Hermon's direct attached DDR memory.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -2666,7 +2667,7 @@
 	 */
 	num_qp_per_mcg = state->hs_cfg_profile->cp_num_qp_per_mcg + 8;
 	log2 = highbit(num_qp_per_mcg);
-	if ((num_qp_per_mcg & (num_qp_per_mcg - 1)) == 0) {
+	if (ISP2(num_qp_per_mcg)) {
 		log2 = log2 - 1;
 	}
 	state->hs_cfg_profile->cp_num_qp_per_mcg = (1 << log2) - 8;
--- old/usr/src/uts/common/io/ib/adapters/hermon/hermon_srq.c	2014-10-23 10:42:13.663080879 -0400
+++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_srq.c	2014-10-23 10:42:13.667940017 -0400
@@ -31,6 +31,7 @@
  *    modifying and posting shared receive queues.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -174,7 +175,7 @@
 	 */
 	srq_wr_sz = max(sizes->srq_wr_sz + 1, HERMON_SRQ_MIN_SIZE);
 	log_srq_size = highbit(srq_wr_sz);
-	if ((srq_wr_sz & (srq_wr_sz - 1)) == 0) {
+	if (ISP2(srq_wr_sz)) {
 		log_srq_size = log_srq_size - 1;
 	}
 
@@ -623,7 +624,7 @@
 	 */
 	size = max(size, HERMON_SRQ_MIN_SIZE);
 	log_srq_size = highbit(size);
-	if ((size & (size - 1)) == 0) {
+	if (ISP2(size)) {
 		log_srq_size = log_srq_size - 1;
 	}
 
@@ -974,7 +975,7 @@
 		 */
 		max_size = (HERMON_QP_WQE_MLX_SRQ_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
--- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c	2014-10-23 10:42:13.846838942 -0400
+++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c	2014-10-23 10:42:13.851719829 -0400
@@ -32,6 +32,7 @@
  *    down the list of Tavor configuration information.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -657,7 +658,7 @@
 	 */
 	max_size = (TAVOR_QP_WQE_MLX_QP1_HDRS + (max_sgl << 4));
 	log2 = highbit(max_size);
-	if ((max_size & (max_size - 1)) == 0) {
+	if (ISP2(max_size)) {
 		log2 = log2 - 1;
 	}
 	max_size = (1 << log2);
--- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c	2014-10-23 10:42:14.015612432 -0400
+++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c	2014-10-23 10:42:14.020680420 -0400
@@ -317,11 +317,11 @@
 	attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, TAVOR_QP_MIN_SIZE);
 	attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, TAVOR_QP_MIN_SIZE);
 	log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
-	if ((attr_p->qp_sizes.cs_sq & (attr_p->qp_sizes.cs_sq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_sq)) {
 		log_qp_sq_size = log_qp_sq_size - 1;
 	}
 	log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
-	if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_rq)) {
 		log_qp_rq_size = log_qp_rq_size - 1;
 	}
 
@@ -803,11 +803,11 @@
 	attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, TAVOR_QP_MIN_SIZE);
 	attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, TAVOR_QP_MIN_SIZE);
 	log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
-	if ((attr_p->qp_sizes.cs_sq & (attr_p->qp_sizes.cs_sq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_sq)) {
 		log_qp_sq_size = log_qp_sq_size - 1;
 	}
 	log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
-	if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
+	if (ISP2(attr_p->qp_sizes.cs_rq)) {
 		log_qp_rq_size = log_qp_rq_size - 1;
 	}
 
@@ -1991,7 +1991,7 @@
 		 */
 		max_size = (TAVOR_QP_WQE_MLX_SND_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2008,7 +2008,7 @@
 		 */
 		max_size = (TAVOR_QP_WQE_MLX_RCV_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2028,7 +2028,7 @@
 		 */
 		max_size = (TAVOR_QP_WQE_MLX_QP0_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
@@ -2050,7 +2050,7 @@
 		 */
 		max_size = (TAVOR_QP_WQE_MLX_QP1_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
--- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_qpmod.c	2014-10-23 10:42:14.237557971 -0400
+++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_qpmod.c	2014-10-23 10:42:14.244393748 -0400
@@ -33,6 +33,7 @@
  *    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>
@@ -3438,7 +3439,7 @@
 	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);
@@ -3474,7 +3475,7 @@
 	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);
--- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_rsrc.c	2014-10-23 10:42:14.540438256 -0400
+++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_rsrc.c	2014-10-23 10:42:14.545442641 -0400
@@ -33,6 +33,7 @@
  *    by Tavor hardware or which live in Tavor's direct attached DDR memory.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -2885,7 +2886,7 @@
 	 */
 	num_qp_per_mcg = state->ts_cfg_profile->cp_num_qp_per_mcg + 8;
 	log2 = highbit(num_qp_per_mcg);
-	if ((num_qp_per_mcg & (num_qp_per_mcg - 1)) == 0) {
+	if (ISP2(num_qp_per_mcg)) {
 		log2 = log2 - 1;
 	}
 	state->ts_cfg_profile->cp_num_qp_per_mcg = (1 << log2) - 8;
--- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_srq.c	2014-10-23 10:42:14.783717026 -0400
+++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_srq.c	2014-10-23 10:42:14.788855529 -0400
@@ -32,6 +32,7 @@
  *    modifying and posting shared receive queues.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/ddi.h>
@@ -172,7 +173,7 @@
 	 */
 	sizes->srq_wr_sz = max(sizes->srq_wr_sz, TAVOR_SRQ_MIN_SIZE);
 	log_srq_size = highbit(sizes->srq_wr_sz);
-	if ((sizes->srq_wr_sz & (sizes->srq_wr_sz - 1)) == 0) {
+	if (ISP2(sizes->srq_wr_sz)) {
 		log_srq_size = log_srq_size - 1;
 	}
 
@@ -686,7 +687,7 @@
 	 */
 	size = max(size, TAVOR_SRQ_MIN_SIZE);
 	log_srq_size = highbit(size);
-	if ((size & (size - 1)) == 0) {
+	if (ISP2(size)) {
 		log_srq_size = log_srq_size - 1;
 	}
 
@@ -1099,7 +1100,7 @@
 		 */
 		max_size = (TAVOR_QP_WQE_MLX_RCV_HDRS + (num_sgl << 4));
 		log2 = highbit(max_size);
-		if ((max_size & (max_size - 1)) == 0) {
+		if (ISP2(max_size)) {
 			log2 = log2 - 1;
 		}
 
--- old/usr/src/uts/common/io/ib/clients/rds/rdssubr.c	2014-10-23 10:42:14.964025501 -0400
+++ new/usr/src/uts/common/io/ib/clients/rds/rdssubr.c	2014-10-23 10:42:14.968970420 -0400
@@ -23,6 +23,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/ib/clients/rds/rds.h>
 #include <sys/ib/clients/rds/rds_kstat.h>
 
@@ -149,7 +150,7 @@
 {
 	int i;
 
-	if (rds_bind_fanout_size & (rds_bind_fanout_size - 1)) {
+	if (!ISP2(rds_bind_fanout_size)) {
 		/* Not a power of two. Round up to nearest power of two */
 		for (i = 0; i < UINT_32_BITS; i++) {
 			if (rds_bind_fanout_size < (1 << i))
--- old/usr/src/uts/common/io/myri10ge/drv/myri10ge.c	2014-10-23 10:42:15.117609623 -0400
+++ new/usr/src/uts/common/io/myri10ge/drv/myri10ge.c	2014-10-23 10:42:15.122847447 -0400
@@ -2138,7 +2138,7 @@
 	 * buffer/pkt, and the mtu will prevent overruns
 	 */
 	big_pow2 = myri10ge_mtu + MXGEFW_PAD;
-	while ((big_pow2 & (big_pow2 - 1)) != 0)
+	while (!ISP2(big_pow2))
 		big_pow2++;
 
 	/* now give firmware buffers sizes, and MTU */
@@ -5437,7 +5437,7 @@
 	 */
 	while (mgp->num_slices > 1) {
 		/* make sure it is a power of two */
-		while (mgp->num_slices & (mgp->num_slices - 1))
+		while (!ISP2(mgp->num_slices))
 			mgp->num_slices--;
 		if (mgp->num_slices == 1)
 			return (0);
--- old/usr/src/uts/common/io/ntxn/unm_gem.c	2014-10-23 10:42:15.473729176 -0400
+++ new/usr/src/uts/common/io/ntxn/unm_gem.c	2014-10-23 10:42:15.478763125 -0400
@@ -725,8 +725,7 @@
 
 	tx_desc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 	    txringsize_propname, MAX_CMD_DESCRIPTORS_HOST);
-	if (tx_desc >= 256 && tx_desc <= MAX_CMD_DESCRIPTORS &&
-	    !(tx_desc & (tx_desc - 1))) {
+	if (tx_desc >= 256 && tx_desc <= MAX_CMD_DESCRIPTORS && ISP2(tx_desc)) {
 		adapter->MaxTxDescCount = tx_desc;
 	} else {
 		cmn_err(CE_WARN, "%s%d: TxRingSize defaulting to %d, since "
@@ -739,8 +738,7 @@
 	rx_desc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 	    rxringsize_propname, maxrx);
 	if (rx_desc >= NX_MIN_DRIVER_RDS_SIZE &&
-	    rx_desc <= NX_MAX_SUPPORTED_RDS_SIZE &&
-	    !(rx_desc & (rx_desc - 1))) {
+	    rx_desc <= NX_MAX_SUPPORTED_RDS_SIZE && ISP2(rx_desc)) {
 		adapter->MaxRxDescCount = rx_desc;
 	} else {
 		cmn_err(CE_WARN, "%s%d: RxRingSize defaulting to %d, since "
@@ -753,8 +751,7 @@
 	rx_jdesc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 	    jumborxringsize_propname, MAX_JUMBO_RCV_DESCRIPTORS);
 	if (rx_jdesc >= NX_MIN_DRIVER_RDS_SIZE &&
-	    rx_jdesc <= NX_MAX_SUPPORTED_JUMBO_RDS_SIZE &&
-	    !(rx_jdesc & (rx_jdesc - 1))) {
+	    rx_jdesc <= NX_MAX_SUPPORTED_JUMBO_RDS_SIZE && ISP2(rx_jdesc)) {
 		adapter->MaxJumboRxDescCount = rx_jdesc;
 	} else {
 		cmn_err(CE_WARN, "%s%d: JumboRingSize defaulting to %d, since "
--- old/usr/src/uts/common/krtld/kobj.c	2014-10-23 10:42:15.662747159 -0400
+++ new/usr/src/uts/common/krtld/kobj.c	2014-10-23 10:42:15.667924363 -0400
@@ -3787,7 +3787,7 @@
 	hdr = kobj_comphdr(file);
 	if (hdr->ch_magic != CH_MAGIC_ZLIB || hdr->ch_version != CH_VERSION ||
 	    hdr->ch_algorithm != CH_ALG_ZLIB || hdr->ch_fsize == 0 ||
-	    (hdr->ch_blksize & (hdr->ch_blksize - 1)) != 0) {
+	    !ISP2(hdr->ch_blksize)) {
 		kobj_free(file->_dbuf, cip->fsize);
 		return (-1);
 	}
--- old/usr/src/uts/common/os/group.c	2014-10-23 10:42:15.937633804 -0400
+++ new/usr/src/uts/common/os/group.c	2014-10-23 10:42:15.942535834 -0400
@@ -23,6 +23,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/systm.h>
 #include <sys/param.h>
 #include <sys/debug.h>
@@ -131,8 +132,7 @@
 	g->grp_size--;
 
 	if ((gflag & GRP_RESIZE) &&
-	    g->grp_size > GRP_SET_SIZE_DEFAULT &&
-	    ((g->grp_size - 1) & g->grp_size) == 0)
+	    g->grp_size > GRP_SET_SIZE_DEFAULT && ISP2(g->grp_size))
 		group_shrink_set(g);
 
 	return (0);
--- old/usr/src/uts/common/os/kmem.c	2014-10-23 10:42:16.093477383 -0400
+++ new/usr/src/uts/common/os/kmem.c	2014-10-23 10:42:16.098724631 -0400
@@ -3766,7 +3766,7 @@
 	if (align < KMEM_ALIGN)
 		cflags |= KMC_NOTOUCH;
 
-	if ((align & (align - 1)) != 0 || align > vmp->vm_quantum)
+	if (!ISP2(align) || align > vmp->vm_quantum)
 		panic("kmem_cache_create: bad alignment %lu", align);
 
 	mutex_enter(&kmem_flags_lock);
--- old/usr/src/uts/common/os/vmem.c	2014-10-23 10:42:16.437786969 -0400
+++ new/usr/src/uts/common/os/vmem.c	2014-10-23 10:42:16.442998056 -0400
@@ -920,7 +920,7 @@
 	int flist = 0;
 	ASSERT(MUTEX_HELD(&vmp->vm_lock));
 
-	if ((size & (size - 1)) == 0)
+	if (ISP2(size))
 		flist = lowbit(P2ALIGN(vmp->vm_freemap, size));
 	else if ((hb = highbit(size)) < VMEM_FREELISTS)
 		flist = lowbit(P2ALIGN(vmp->vm_freemap, 1UL << hb));
@@ -959,8 +959,7 @@
 		    (void *)vmp, size, align_arg, phase, nocross,
 		    minaddr, maxaddr, vmflag);
 
-	if (phase >= align || (align & (align - 1)) != 0 ||
-	    (nocross & (nocross - 1)) != 0)
+	if (phase >= align || !ISP2(align) || !ISP2(nocross))
 		panic("vmem_xalloc(%p, %lu, %lu, %lu, %lu, %p, %p, %x): "
 		    "parameters inconsistent or invalid",
 		    (void *)vmp, size, align_arg, phase, nocross,
@@ -994,7 +993,7 @@
 		 *
 		 * (4)	We're doing a best-fit or first-fit allocation.
 		 */
-		if ((size & (size - 1)) == 0) {
+		if (ISP2(size)) {
 			flist = lowbit(P2ALIGN(vmp->vm_freemap, size));
 		} else {
 			hb = highbit(size);
@@ -1290,7 +1289,7 @@
 	mutex_enter(&vmp->vm_lock);
 
 	if (vmp->vm_nsegfree >= VMEM_MINFREE || vmem_populate(vmp, vmflag)) {
-		if ((size & (size - 1)) == 0)
+		if (ISP2(size))
 			flist = lowbit(P2ALIGN(vmp->vm_freemap, size));
 		else if ((hb = highbit(size)) < VMEM_FREELISTS)
 			flist = lowbit(P2ALIGN(vmp->vm_freemap, 1UL << hb));
--- old/usr/src/uts/common/vm/seg_kmem.c	2014-10-23 10:42:16.635508827 -0400
+++ new/usr/src/uts/common/vm/seg_kmem.c	2014-10-23 10:42:16.640685810 -0400
@@ -1288,10 +1288,10 @@
 			 * backoff at trying large pages and reaping
 			 */
 			if (lpthrt > segkmem_lpthrottle_start &&
-			    (lpthrt & (lpthrt - 1))) {
+			    !ISP2(lpthrt)) {
 				lpcb->allocs_throttled++;
 				lpthrt--;
-				if ((lpthrt & (lpthrt - 1)) == 0)
+				if (ISP2(lpthrt))
 					kmem_reap();
 				return (segkmem_alloc(vmp, size, vmflag));
 			}
@@ -1475,15 +1475,13 @@
 	}
 
 	/* set heap_lp quantum if necessary */
-	if (segkmem_heaplp_quantum == 0 ||
-	    (segkmem_heaplp_quantum & (segkmem_heaplp_quantum - 1)) ||
+	if (segkmem_heaplp_quantum == 0 || !ISP2(segkmem_heaplp_quantum) ||
 	    P2PHASE(segkmem_heaplp_quantum, segkmem_lpsize)) {
 		segkmem_heaplp_quantum = segkmem_lpsize;
 	}
 
 	/* set kmem_lp quantum if necessary */
-	if (segkmem_kmemlp_quantum == 0 ||
-	    (segkmem_kmemlp_quantum & (segkmem_kmemlp_quantum - 1)) ||
+	if (segkmem_kmemlp_quantum == 0 || !ISP2(segkmem_kmemlp_quantum) ||
 	    segkmem_kmemlp_quantum > segkmem_heaplp_quantum) {
 		segkmem_kmemlp_quantum = segkmem_heaplp_quantum;
 	}
--- old/usr/src/uts/common/vm/seg_map.c	2014-10-23 10:42:16.827741655 -0400
+++ new/usr/src/uts/common/vm/seg_map.c	2014-10-23 10:42:16.832539327 -0400
@@ -337,7 +337,7 @@
 		"%d, using %d", nfreelist, max_ncpus);
 		nfreelist = max_ncpus;
 	}
-	if (nfreelist & (nfreelist - 1)) {
+	if (!ISP2(nfreelist)) {
 		/* round up nfreelist to the next power of two. */
 		nfreelist = 1 << (highbit(nfreelist));
 	}
--- old/usr/src/uts/common/vm/vpm.c	2014-10-23 10:42:17.040823067 -0400
+++ new/usr/src/uts/common/vm/vpm.c	2014-10-23 10:42:17.045705182 -0400
@@ -205,7 +205,7 @@
 	/*
 	 * Round it up to the next power of 2
 	 */
-	if (vpm_nfreelist & (vpm_nfreelist - 1)) {
+	if (!ISP2(vpm_nfreelist)) {
 		vpm_nfreelist = 1 << (highbit(vpm_nfreelist));
 	}
 	vpmd_freemsk = vpm_nfreelist - 1;
--- old/usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.c	2014-10-23 10:42:17.227173886 -0400
+++ new/usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.c	2014-10-23 10:42:17.234840056 -0400
@@ -895,7 +895,7 @@
 		    "(%d) physical processors on one board.",
 		    MAX_CMP_UNITS_PER_BOARD);
 		return (ENXIO);
-	} else if (MAX_CORES_PER_CMP & (MAX_CORES_PER_CMP - 1)) {
+	} else if (!ISP2(MAX_CORES_PER_CMP)) {
 		cmn_err(CE_WARN, "!drmach_init: number of logical CPUs (%d) in "
 		    "physical processor is not power of 2.",
 		    MAX_CORES_PER_CMP);
--- old/usr/src/uts/i86pc/io/pci/pci_tools.c	2014-10-23 10:42:17.493225624 -0400
+++ new/usr/src/uts/i86pc/io/pci/pci_tools.c	2014-10-23 10:42:17.497919282 -0400
@@ -22,6 +22,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/mkdev.h>
 #include <sys/stat.h>
@@ -588,7 +589,7 @@
 	pci_cfgacc_req_t req;
 	uint32_t max_offset;
 
-	if ((size <= 0) || (size > 8) || ((size & (size - 1)) != 0)) {
+	if ((size <= 0) || (size > 8) || !ISP2(size)) {
 		prg->status = PCITOOL_INVALID_SIZE;
 		return (ENOTSUP);
 	}
--- old/usr/src/uts/i86pc/io/rootnex.c	2014-10-23 10:42:17.669336204 -0400
+++ new/usr/src/uts/i86pc/io/rootnex.c	2014-10-23 10:42:17.674615628 -0400
@@ -1811,7 +1811,7 @@
 	 * granularity may or may not be a power of two. If it isn't, we can't
 	 * use a simple mask.
 	 */
-	if (attr->dma_attr_granular & (attr->dma_attr_granular - 1)) {
+	if (!ISP2(attr->dma_attr_granular)) {
 		dma->dp_granularity_power_2 = B_FALSE;
 	} else {
 		dma->dp_granularity_power_2 = B_TRUE;
@@ -3869,7 +3869,7 @@
 #endif /* __amd64 */
 
 		/* figure out if the copybuf size is a power of 2 */
-		if (dma->dp_copybuf_size & (dma->dp_copybuf_size - 1)) {
+		if (!ISP2(dma->dp_copybuf_size)) {
 			copybuf_sz_power_2 = B_FALSE;
 		} else {
 			copybuf_sz_power_2 = B_TRUE;
--- old/usr/src/uts/i86pc/os/ddi_impl.c	2014-10-23 10:42:17.974635652 -0400
+++ new/usr/src/uts/i86pc/os/ddi_impl.c	2014-10-23 10:42:17.979572466 -0400
@@ -1536,7 +1536,7 @@
 	 * the attributes leads to a failure.
 	 */
 	uint_t cache_attr = IOMEM_CACHE_ATTR(flags);
-	if ((cache_attr != 0) && ((cache_attr & (cache_attr - 1)) != 0))
+	if ((cache_attr != 0) && !ISP2(cache_attr))
 		return (B_FALSE);
 
 	/* All cache attributes are supported on X86/X64 */
@@ -1627,9 +1627,8 @@
 	}
 
 	if (attr->dma_attr_minxfer == 0 || attr->dma_attr_align == 0 ||
-	    (attr->dma_attr_align & (attr->dma_attr_align - 1)) ||
-	    (attr->dma_attr_minxfer & (attr->dma_attr_minxfer - 1))) {
-			return (DDI_FAILURE);
+	    !ISP2(attr->dma_attr_align) || !ISP2(attr->dma_attr_minxfer)) {
+		return (DDI_FAILURE);
 	}
 
 	/*
--- old/usr/src/uts/intel/io/drm/i915_gem_tiling.c	2014-10-23 10:42:18.208596499 -0400
+++ new/usr/src/uts/intel/io/drm/i915_gem_tiling.c	2014-10-23 10:42:18.215217221 -0400
@@ -33,6 +33,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/sysmacros.h>
 #include "drmP.h"
 #include "drm.h"
 #include "i915_drm.h"
@@ -246,7 +247,7 @@
 	if (stride < tile_width)
 		return 0;
 
-	if (stride & (stride - 1))
+	if (!ISP2(stride))
 		return 0;
 
 	/* We don't handle the aperture area covered by the fence being bigger
--- old/usr/src/uts/sun4/io/px/px_debug.c	2014-10-23 10:42:18.404258100 -0400
+++ new/usr/src/uts/sun4/io/px/px_debug.c	2014-10-23 10:42:18.411993709 -0400
@@ -23,11 +23,10 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * PCI nexus driver general debug support
  */
+#include <sys/sysmacros.h>
 #include <sys/async.h>
 #include <sys/sunddi.h>		/* dev_info_t */
 #include <sys/ddi_impldefs.h>
@@ -256,7 +255,7 @@
 		int size = px_dbg_msg_size;
 
 		/* Check if px_dbg_msg_size is ^2 */
-		size = (size & (size - 1)) ? ((size | ~size) + 1) : size;
+		size = !ISP2(size) ? ((size | ~size) + 1) : size;
 		px_dbg_msg_size = size;
 		px_dbg_qmask = size - 1;
 		px_dbg_msgq = kmem_zalloc(sizeof (px_dbg_msg_t) * size,
--- old/usr/src/uts/sun4/os/ddi_impl.c	2014-10-23 10:42:18.573567398 -0400
+++ new/usr/src/uts/sun4/os/ddi_impl.c	2014-10-23 10:42:18.578711062 -0400
@@ -1001,7 +1001,7 @@
 	 * the attributes leads to a failure.
 	 */
 	uint_t cache_attr = IOMEM_CACHE_ATTR(flags);
-	if ((cache_attr != 0) && ((cache_attr & (cache_attr - 1)) != 0))
+	if ((cache_attr != 0) && !ISP2(cache_attr))
 		return (B_FALSE);
 
 	/*
@@ -1143,14 +1143,14 @@
 	/*
 	 * Make sure that the initial value is sane
 	 */
-	if (i & (i - 1))
+	if (!ISP2(i))
 		return (0);
 	if (i == 0)
 		i = (stream) ? 4 : 1;
 
 	r = ddi_ctlops(a, a,
 	    DDI_CTLOPS_IOMIN, (void *)(uintptr_t)stream, (void *)&i);
-	if (r != DDI_SUCCESS || (i & (i - 1)))
+	if (r != DDI_SUCCESS || !ISP2(i))
 		return (0);
 	return (i);
 }
@@ -1177,8 +1177,7 @@
 	}
 
 	if (attr->dma_attr_minxfer == 0 || attr->dma_attr_align == 0 ||
-	    (attr->dma_attr_align & (attr->dma_attr_align - 1)) ||
-	    (attr->dma_attr_minxfer & (attr->dma_attr_minxfer - 1))) {
+	    !ISP2(attr->dma_attr_align) || !ISP2(attr->dma_attr_minxfer)) {
 		return (DDI_FAILURE);
 	}
 
--- old/usr/src/uts/sun4v/io/ds_pri.c	2014-10-23 10:42:18.779587675 -0400
+++ new/usr/src/uts/sun4v/io/ds_pri.c	2014-10-23 10:42:18.784454553 -0400
@@ -910,7 +910,7 @@
 	 * contig_mem_alloc requires size to be a power of 2.
 	 * Increase size to next power of 2 if necessary.
 	 */
-	if ((pri_size & (pri_size - 1)) != 0)
+	if (!ISP2(pri_size))
 		buf_size = 1 << highbit(pri_size);
 	DS_PRI_DBG("ds_get_hv_pri: buf_size = 0x%lx\n", buf_size);
 
--- old/usr/src/uts/sun4v/os/fillsysinfo.c	2014-10-23 10:42:18.951526952 -0400
+++ new/usr/src/uts/sun4v/os/fillsysinfo.c	2014-10-23 10:42:18.956334645 -0400
@@ -465,7 +465,7 @@
 
 	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;
 
 	/*
@@ -850,7 +850,7 @@
 
 	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);
 	}
 
--- old/usr/src/uts/sun4v/os/intrq.c	2014-10-23 10:42:19.137269464 -0400
+++ new/usr/src/uts/sun4v/os/intrq.c	2014-10-23 10:42:19.142084317 -0400
@@ -23,6 +23,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/sysmacros.h>
 #include <sys/machsystm.h>
 #include <sys/cpu.h>
 #include <sys/intreg.h>
@@ -98,7 +99,7 @@
 	 * contig_mem_alloc() requires size to be a power of 2.
 	 * Increase size to a power of 2 if necessary.
 	 */
-	if ((size & (size - 1)) != 0) {
+	if (!ISP2(size)) {
 		size = 1 << highbit(size);
 	}
 
@@ -208,7 +209,7 @@
 	 * contig_mem_alloc() requires size to be a power of 2.
 	 * Increase size to a power of 2 if necessary.
 	 */
-	if ((cpu_list_size & (cpu_list_size - 1)) != 0) {
+	if (!ISP2(cpu_list_size)) {
 		cpu_list_size = 1 << highbit(cpu_list_size);
 	}
 
