Simplify this helper function by using a bit-shift to set the high banks select bit. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/comedi/drivers/ni_stc.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index aca6e5c..3c5ba61 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) -- 2.3.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel