From: H Hartley Sweeten Date: Fri, 1 May 2015 21:58:33 +0000 (-0700) Subject: staging: comedi: ni_stc.h: simplify MSeries_AI_Config_Bank_Bits() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b6cd5c228edefaa0143faffdb1ebf85e3afc5a43;p=linux-beck.git 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- 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)