[PATCH 3/4] Staging: Comedi adv_pci1710: Combined two conditions

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

 



Combined two if statements making the code cleaner, removing one level
of indentation.

Signed-off-by: Tomas Melin <tomas.melin@xxxxxx>
---
 drivers/staging/comedi/drivers/adv_pci1710.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c
index ef8b429..9c17cd1 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -1167,12 +1167,11 @@ static int check_channel_list(struct comedi_device *dev,
 	for (i = 1, seglen = 1; i < n_chan; i++, seglen++) {
 		if (chanlist[0] == chanlist[i])
 			break;	/*  we detected a loop, stop */
-		if (CR_CHAN(chanlist[i]) & 1)
-			if (CR_AREF(chanlist[i]) == AREF_DIFF) {
-				comedi_error(dev,
-					     "Odd channel cannot be differential input!\n");
-				return 0;
-			}
+		if ((CR_CHAN(chanlist[i]) & 1) &&
+		    (CR_AREF(chanlist[i]) == AREF_DIFF)) {
+			comedi_error(dev, "Odd channel cannot be differential input!\n");
+			return 0;
+		}
 		nowmustbechan =
 			(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
 		if (CR_AREF(chansegment[i - 1]) == AREF_DIFF)
-- 
1.7.9.5

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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