diff options
| author | 2015-05-01 14:58:33 -0700 | |
|---|---|---|
| committer | 2015-05-09 19:05:03 +0200 | |
| commit | b6cd5c228edefaa0143faffdb1ebf85e3afc5a43 (patch) | |
| tree | 12de0a0f24a729d85f00584baadc7100b63a0cf7 | |
| parent | staging: comedi: ni_stc.h: reg_type is not needed by MSeries_AI_Config_Bank_Bits() (diff) | |
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: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/comedi/drivers/ni_stc.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index aca6e5c34080..3c5ba613a2d6 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -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) |
