diff options
| author | Josef 'Jeff' Sipek <josef.sipek@nexenta.com> | 2014-10-31 20:49:13 -0400 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2014-11-10 21:21:26 -0800 |
| commit | de710d24d2fae4468e64da999e1d952a247f142c (patch) | |
| tree | be58a948ed9109a8dea89302c0bfecec604f1c7e /usr/src/uts/sun4/os | |
| parent | 59b0aa363020bcc817969e1c15ac920d3f866e83 (diff) | |
| download | illumos-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/os')
| -rw-r--r-- | usr/src/uts/sun4/os/ddi_impl.c | 9 |
1 files changed, 4 insertions, 5 deletions
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); } |
