summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2013-10-16 14:40:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-16 12:48:31 -0700
commitf23b65a58888555524851086d0fa418525650c83 (patch)
tree643d2970750816a4048de1593116bec10a4e3cd8 /drivers/staging/comedi
parent4bf59ce248250f4c847a2a9d51713233c88f1d0f (diff)
downloadop-kernel-dev-f23b65a58888555524851086d0fa418525650c83.zip
op-kernel-dev-f23b65a58888555524851086d0fa418525650c83.tar.gz
staging: comedi: pcmmio: sample types are unsigned
Sample values in comedi are generally represented as unsigned values. Change `interrupt_pcmmio()` and `ai_rinsn()` in the "pcmmio" module to use unsigned sample values for consistency. Also, make the order in which `interrupt_pcmmio()` writes the two sample values (each actually containing up to 16 1-bit sample values) independent of the host byte ordering. Note that this module is a mess, so please excuse the checkpatch warnings. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/pcmmio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
index 574443d..14cee3a 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -553,12 +553,11 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
val |= (1U << n);
}
/* Write the scan to the buffer. */
- if (comedi_buf_put(s->async, ((short *)&val)[0])
+ if (comedi_buf_put(s->async, val)
&&
comedi_buf_put
(s->async,
- ((short *)
- &val)[1])) {
+ val >> 16)) {
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
} else {
/* Overflow! Stop acquisition!! */
@@ -846,7 +845,7 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
CR_RANGE(insn->chanspec), aref = CR_AREF(insn->chanspec);
unsigned char command_byte = 0;
unsigned iooffset = 0;
- short sample, adc_adjust = 0;
+ unsigned short sample, adc_adjust = 0;
if (chan > 7)
chan -= 8, iooffset = 4; /*
OpenPOWER on IntegriCloud