treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / media / pci / cx25821 / cx25821-biffuncs.h
blob6c1aa132e27fbcf2847e7f6cdcdf24743665b3f3
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Driver for the Conexant CX25821 PCIe bridge
5 * Copyright (C) 2009 Conexant Systems Inc.
6 * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
7 */
9 #ifndef _BITFUNCS_H
10 #define _BITFUNCS_H
12 #define SetBit(Bit) (1 << Bit)
14 static inline u8 getBit(u32 sample, u8 index)
16 return (u8) ((sample >> index) & 1);
19 static inline u32 clearBitAtPos(u32 value, u8 bit)
21 return value & ~(1 << bit);
24 static inline u32 setBitAtPos(u32 sample, u8 bit)
26 sample |= (1 << bit);
27 return sample;
31 #endif