summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-10-31 12:04:34 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-03 16:34:18 -0800
commit287a143ab42b8d2aa3421e70192895188a23dd3e (patch)
tree3558ed8a2b7ca59e10ef6b93d74fe36bc0a84e14
parent1d3d32a7525bbc9c989f8c3e592dc206ee8b145a (diff)
staging: comedi: adl_pci9111: use sample manipulation helpers
Use the recently added sample manipulation helpers to remove the hardcoded assumption of the sample size. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/adl_pci9111.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c
index 1fd082bf757d..47934c938a4b 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -452,7 +452,7 @@ static void pci9111_ai_munge(struct comedi_device *dev,
unsigned int maxdata = s->maxdata;
unsigned int invert = (maxdata + 1) >> 1;
unsigned int shift = (maxdata == 0xffff) ? 0 : 4;
- unsigned int num_samples = num_bytes / sizeof(short);
+ unsigned int num_samples = comedi_bytes_to_samples(s, num_bytes);
unsigned int i;
for (i = 0; i < num_samples; i++)
@@ -501,7 +501,7 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev,
if (to_read > samples - pos)
to_read = samples - pos;
- total += to_read * sizeof(short);
+ total += comedi_samples_to_bytes(s, to_read);
}
pos += to_read;
@@ -513,7 +513,7 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev,
}
}
- devpriv->stop_counter -= total / sizeof(short);
+ devpriv->stop_counter -= comedi_bytes_to_samples(s, total);
}
static irqreturn_t pci9111_interrupt(int irq, void *p_device)