Commit b6cd5c22 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_stc.h: simplify MSeries_AI_Config_Bank_Bits()

Simplify this helper function by using a bit-shift to set the high
banks select bit.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f496471d
......@@ -992,11 +992,7 @@ static inline unsigned MSeries_AI_Config_Channel_Bits(unsigned channel)
static inline unsigned MSeries_AI_Config_Bank_Bits(unsigned channel)
{
unsigned bits = channel & 0x30;
if (channel & 0x40)
bits |= 0x400;
return bits;
return ((channel & 0x40) << 4) | (channel & 0x30);
}
static inline unsigned MSeries_AI_Config_Gain_Bits(unsigned range)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment