3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-14 16:09:24 +01:00

util: Add util_is_bit_set

This commit is contained in:
Denis Kenzior 2014-12-29 19:43:23 -06:00
parent 56f1ccf7f2
commit e90ca652fd

View File

@ -33,4 +33,10 @@ static inline uint8_t util_bit_field(const uint8_t oct, int start, int num)
unsigned char mask = (1 << num) - 1;
return (oct >> start) & mask;
}
static inline bool util_is_bit_set(const uint8_t oct, int bit)
{
int mask = 1 << bit;
return oct & mask ? true : false;
}
#endif /* __UTIL_H */