tests or sets bit of a u8 type array

来源:互联网 发布:影音先锋怎么恢复数据 编辑:程序博客网 时间:2024/06/07 05:29

tests or sets bit of a u8 type array

static inline int uvc_test_bit(const __u8 *data, int bit)

{
return (data[bit >> 3] >> (bit & 7)) & 1;
}

static inline void uvc_clear_bit(__u8 *data, int bit)
{
data[bit >> 3] &= ~(1 << (bit & 7));

}

notice:  data is u8 type ptr, so it can tests or sets bit of a u8 type array.

0 0