Changeset ca212a51 in mainline for uspace/srv/bd/hr/util.c


Ignore:
Timestamp:
2025-07-11T20:13:38Z (13 days ago)
Author:
Miroslav Cimerman <mc@…>
Children:
a0abd46
Parents:
b127da2f
Message:

hr: RAID 0, 5: init strip size to closest (down) pow of 2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/util.c

    rb127da2f rca212a51  
    12541254}
    12551255
     1256uint32_t hr_closest_pow2(uint32_t n)
     1257{
     1258        if (n == 0)
     1259                return 0;
     1260
     1261        n |= (n >> 1);
     1262        n |= (n >> 2);
     1263        n |= (n >> 4);
     1264        n |= (n >> 8);
     1265        n |= (n >> 16);
     1266        return n - (n >> 1);
     1267}
     1268
    12561269/** @}
    12571270 */
Note: See TracChangeset for help on using the changeset viewer.