diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-01-04 11:33:24 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-07 14:37:12 -0800 |
commit | 8bd48c9ef1f1af96dc699e67a8dc985046e6f22b (patch) | |
tree | 536e5e135f7e28723bd4d1c7d89a29941fec4b3f /drivers/staging/comedi/drivers/comedi_test.c | |
parent | ea4f72b27985e21c846ffbff1a27871db4f8708e (diff) |
staging: comedi: comedi_test: make samples unsigned
Represent the fake samples as unsigned shorts instead of signed shorts,
as this is the usual Comedi convention. There is no change to the
actual binary representation, although the `cfc_write_to_buffer()` call
currently expects a signed short for some bizarre reason.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/comedi_test.c')
-rw-r--r-- | drivers/staging/comedi/drivers/comedi_test.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index 48255b37bf27..ce13fbc52ef9 100644 --- a/drivers/staging/comedi/drivers/comedi_test.c +++ b/drivers/staging/comedi/drivers/comedi_test.c @@ -85,8 +85,9 @@ static const struct comedi_lrange waveform_ai_ranges = { } }; -static short fake_sawtooth(struct comedi_device *dev, unsigned int range_index, - unsigned long current_time) +static unsigned short fake_sawtooth(struct comedi_device *dev, + unsigned int range_index, + unsigned long current_time) { struct waveform_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; @@ -109,9 +110,9 @@ static short fake_sawtooth(struct comedi_device *dev, unsigned int range_index, return offset + value; } -static short fake_squarewave(struct comedi_device *dev, - unsigned int range_index, - unsigned long current_time) +static unsigned short fake_squarewave(struct comedi_device *dev, + unsigned int range_index, + unsigned long current_time) { struct waveform_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; @@ -131,15 +132,17 @@ static short fake_squarewave(struct comedi_device *dev, return offset + value; } -static short fake_flatline(struct comedi_device *dev, unsigned int range_index, - unsigned long current_time) +static unsigned short fake_flatline(struct comedi_device *dev, + unsigned int range_index, + unsigned long current_time) { return dev->read_subdev->maxdata / 2; } /* generates a different waveform depending on what channel is read */ -static short fake_waveform(struct comedi_device *dev, unsigned int channel, - unsigned int range, unsigned long current_time) +static unsigned short fake_waveform(struct comedi_device *dev, + unsigned int channel, unsigned int range, + unsigned long current_time) { enum { SAWTOOTH_CHAN, |