summaryrefslogtreecommitdiff
path: root/lib/pow2.h
blob: 2cbca1ab3484d55757e9c1785a5459d674d5328c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef FIO_POW2_H
#define FIO_POW2_H

#include <inttypes.h>
#include "types.h"

static inline bool is_power_of_2(uint64_t val)
{
	return (val != 0 && ((val & (val - 1)) == 0));
}

#endif