Commit 41d8cc1a authored by Tomas Melin's avatar Tomas Melin Committed by Greg Kroah-Hartman

Staging: Comedi adv_pci1710: Move check forward

Simplifies function logic by assuming that n_chan >1 if not <=1.
Removes one level of indentation.
Signed-off-by: default avatarTomas Melin <tomas.melin@iki.fi>
Acked-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00a61d86
......@@ -1161,7 +1161,9 @@ static int check_channel_list(struct comedi_device *dev,
return 0;
}
if (n_chan > 1) {
if (n_chan == 1)
return 1; /* seglen=1 */
chansegment[0] = chanlist[0]; /* first channel is every time ok */
for (i = 1, seglen = 1; i < n_chan; i++, seglen++) { /* build part of chanlist */
/* printk("%d. %d %d\n",i,CR_CHAN(chanlist[i]),CR_RANGE(chanlist[i])); */
......@@ -1201,9 +1203,6 @@ static int check_channel_list(struct comedi_device *dev,
return 0; /* chan/gain list is strange */
}
}
} else {
seglen = 1;
}
return seglen;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment