[PATCH] staging: comedi: cb_pcidas64: Fixed coding issue about multiple line dereferencing

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

 



Fixed coding issue about multiple line dereferencing

Signed-off-by: Devendra Sharma <devendra.sharma9091@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index cb9c269..9ace9c0 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -2475,20 +2475,17 @@ static int setup_channel_queue(struct comedi_device *dev,
 			/* load external queue */
 			for (i = 0; i < cmd->chanlist_len; i++) {
 				bits = 0;
+				unsigned int ch = cmd->chanlist[i];
 				/* set channel */
-				bits |= adc_chan_bits(CR_CHAN(cmd->
-							      chanlist[i]));
+				bits |= adc_chan_bits(CR_CHAN(ch));
 				/* set gain */
 				bits |= ai_range_bits_6xxx(dev,
-							   CR_RANGE(cmd->
-								    chanlist
-								    [i]));
+							   CR_RANGE(ch));
 				/* set single-ended / differential */
 				bits |= se_diff_bit_6xxx(dev,
-							 CR_AREF(cmd->
-								 chanlist[i]) ==
+							 CR_AREF(ch) ==
 							 AREF_DIFF);
-				if (CR_AREF(cmd->chanlist[i]) == AREF_COMMON)
+				if (CR_AREF(ch) == AREF_COMMON)
 					bits |= ADC_COMMON_BIT;
 				/* mark end of queue */
 				if (i == cmd->chanlist_len - 1)
-- 
2.7.4

_______________________________________________
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