Add support for options being a power-of-2
[fio.git] / lib / pow2.h
CommitLineData
0f38bbef
JA
1#ifndef FIO_POW2_H
2#define FIO_POW2_H
3
4#include <inttypes.h>
5
6static inline int is_power_of_2(uint64_t val)
7{
8 return (val != 0 && ((val & (val - 1)) == 0));
9}
10
11#endif