From: Tomas Melin Date: Mon, 7 May 2012 19:50:24 +0000 (+0300) Subject: Staging: Comedi adv_pci1710: Combined two conditions X-Git-Tag: firefly_0821_release~3680^2~2823^2~211 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=583d82316081429dce49dc5c76219fa527a2129c;p=firefly-linux-kernel-4.4.55.git Staging: Comedi adv_pci1710: Combined two conditions Combined two if statements making the code cleaner, removing one level of indentation. Signed-off-by: Tomas Melin Acked-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 6dd4f4a48663..3c754cd91e7b 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -1168,12 +1168,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)