summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4
diff options
context:
space:
mode:
authorJosef 'Jeff' Sipek <josef.sipek@nexenta.com>2014-10-31 20:49:13 -0400
committerRobert Mustacchi <rm@joyent.com>2014-11-10 21:21:26 -0800
commitde710d24d2fae4468e64da999e1d952a247f142c (patch)
treebe58a948ed9109a8dea89302c0bfecec604f1c7e /usr/src/uts/sun4
parent59b0aa363020bcc817969e1c15ac920d3f866e83 (diff)
downloadillumos-joyent-de710d24d2fae4468e64da999e1d952a247f142c.tar.gz
5255 uts shouldn't open-code ISP2
Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/sun4')
-rw-r--r--usr/src/uts/sun4/io/px/px_debug.c5
-rw-r--r--usr/src/uts/sun4/os/ddi_impl.c9
2 files changed, 6 insertions, 8 deletions
diff --git a/usr/src/uts/sun4/io/px/px_debug.c b/usr/src/uts/sun4/io/px/px_debug.c
index 7c2166c499..6d94288615 100644
--- a/usr/src/uts/sun4/io/px/px_debug.c
+++ b/usr/src/uts/sun4/io/px/px_debug.c
@@ -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 @@ px_dbg_attach(dev_info_t *dip, ddi_softint_handle_t *dbg_hdl)
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,
diff --git a/usr/src/uts/sun4/os/ddi_impl.c b/usr/src/uts/sun4/os/ddi_impl.c
index 2c64ae3556..60edae7383 100644
--- a/usr/src/uts/sun4/os/ddi_impl.c
+++ b/usr/src/uts/sun4/os/ddi_impl.c
@@ -1001,7 +1001,7 @@ i_ddi_check_cache_attr(uint_t flags)
* 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 @@ i_ddi_iomin(dev_info_t *a, int i, int stream)
/*
* 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 @@ i_ddi_mem_alloc(dev_info_t *dip, ddi_dma_attr_t *attr,
}
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);
}