Changeset 622 for GPL/branches/uniaud32-next/include/linux/log2.h
- Timestamp:
- Jan 2, 2021, 1:29:57 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/include/linux/log2.h
r615 r622 11 11 { 12 12 return (n != 0 && ((n & (n - 1)) == 0)); 13 }14 15 /*16 * round up to nearest power of two17 */18 static inline19 unsigned long __roundup_pow_of_two(unsigned long n)20 {21 return 1UL << fls_long(n - 1);22 }23 24 /*25 * round down to nearest power of two26 */27 static inline28 unsigned long __rounddown_pow_of_two(unsigned long n)29 {30 return 1UL << (fls_long(n) - 1);31 13 } 32 14
Note:
See TracChangeset
for help on using the changeset viewer.