Print this page
5255 uts shouldn't open-code ISP2

@@ -1534,11 +1534,11 @@
         /*
          * The cache attributes are mutually exclusive. Any combination of
          * 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 */
         if (cache_attr & (IOMEM_DATA_UNCACHED | IOMEM_DATA_CACHED |
             IOMEM_DATA_UC_WR_COMBINE))

@@ -1625,12 +1625,11 @@
         if (length == 0 || kaddrp == NULL || attr == NULL) {
                 return (DDI_FAILURE);
         }
 
         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);
         }
 
         /*
          * figure out most restrictive alignment requirement