brintos

brintos / linux-shallow public Read only

0
0
Text · 565 B · 6c1aa13 Raw
32 lines · c
1/* SPDX-License-Identifier: GPL-2.0-or-later */2/*3 *  Driver for the Conexant CX25821 PCIe bridge4 *5 *  Copyright (C) 2009 Conexant Systems Inc.6 *  Authors  <shu.lin@conexant.com>, <hiep.huynh@conexant.com>7 */8 9#ifndef _BITFUNCS_H10#define _BITFUNCS_H11 12#define SetBit(Bit)  (1 << Bit)13 14static inline u8 getBit(u32 sample, u8 index)15{16	return (u8) ((sample >> index) & 1);17}18 19static inline u32 clearBitAtPos(u32 value, u8 bit)20{21	return value & ~(1 << bit);22}23 24static inline u32 setBitAtPos(u32 sample, u8 bit)25{26	sample |= (1 << bit);27	return sample;28 29}30 31#endif32