[PATCH 008/107] staging: comedi: ni_stc.h: simplify MSeries_AI_Config_Bank_Bits()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux