Commit 9663ab1f authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_common: use comedi_cmd pointer

Use a local variable to access the comedi_cmd as a pointer instead
of getting to from the comedi_async pointer.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae2348e2
...@@ -1468,10 +1468,11 @@ static void ni_ai_munge(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -1468,10 +1468,11 @@ static void ni_ai_munge(struct comedi_device *dev, struct comedi_subdevice *s,
{ {
struct ni_private *devpriv = dev->private; struct ni_private *devpriv = dev->private;
struct comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned int i; struct comedi_cmd *cmd = &async->cmd;
unsigned int length = num_bytes / bytes_per_sample(s); unsigned int length = num_bytes / bytes_per_sample(s);
unsigned short *array = data; unsigned short *array = data;
unsigned int *larray = data; unsigned int *larray = data;
unsigned int i;
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
#ifdef PCIDMA #ifdef PCIDMA
...@@ -1485,7 +1486,7 @@ static void ni_ai_munge(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -1485,7 +1486,7 @@ static void ni_ai_munge(struct comedi_device *dev, struct comedi_subdevice *s,
else else
array[i] += devpriv->ai_offset[chan_index]; array[i] += devpriv->ai_offset[chan_index];
chan_index++; chan_index++;
chan_index %= async->cmd.chanlist_len; chan_index %= cmd->chanlist_len;
} }
} }
...@@ -2710,22 +2711,22 @@ static void ni_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -2710,22 +2711,22 @@ static void ni_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
{ {
const struct ni_board_struct *board = comedi_board(dev); const struct ni_board_struct *board = comedi_board(dev);
struct comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned int range; struct comedi_cmd *cmd = &async->cmd;
unsigned int i;
unsigned int offset;
unsigned int length = num_bytes / sizeof(short); unsigned int length = num_bytes / sizeof(short);
unsigned int offset = 1 << (board->aobits - 1);
unsigned short *array = data; unsigned short *array = data;
unsigned int range;
unsigned int i;
offset = 1 << (board->aobits - 1);
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
range = CR_RANGE(async->cmd.chanlist[chan_index]); range = CR_RANGE(cmd->chanlist[chan_index]);
if (board->ao_unipolar == 0 || (range & 1) == 0) if (board->ao_unipolar == 0 || (range & 1) == 0)
array[i] -= offset; array[i] -= offset;
#ifdef PCIDMA #ifdef PCIDMA
array[i] = cpu_to_le16(array[i]); array[i] = cpu_to_le16(array[i]);
#endif #endif
chan_index++; chan_index++;
chan_index %= async->cmd.chanlist_len; chan_index %= cmd->chanlist_len;
} }
} }
......
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