Skip to content

Commit

Permalink
Staging: Comedi adv_pci1710: Combined two conditions
Browse files Browse the repository at this point in the history
Combined two if statements making the code cleaner, removing one level
of indentation.

Signed-off-by: Tomas Melin <tomas.melin@iki.fi>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tomas Melin authored and Greg Kroah-Hartman committed May 9, 2012
1 parent 2e0031d commit 583d823
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 583d823

Please sign in to comment.