Commit eabbf3f4 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: das16m1: sample types are unsigned

Sample values in comedi are generally represented as unsigned values.
Change the element type of the `ai_buffer[]` member of `struct
das16m1_private_struct` and the types used by `munge_sample()` and
`munge_sample_array()` from `short` to `unsigned short` for consistency.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 92098345
...@@ -131,18 +131,18 @@ struct das16m1_private_struct { ...@@ -131,18 +131,18 @@ struct das16m1_private_struct {
* needed to keep track of whether new count has been loaded into * needed to keep track of whether new count has been loaded into
* counter yet (loaded by first sample conversion) */ * counter yet (loaded by first sample conversion) */
u16 initial_hw_count; u16 initial_hw_count;
short ai_buffer[FIFO_SIZE]; unsigned short ai_buffer[FIFO_SIZE];
unsigned int divisor1; /* divides master clock to obtain conversion speed */ unsigned int divisor1; /* divides master clock to obtain conversion speed */
unsigned int divisor2; /* divides master clock to obtain conversion speed */ unsigned int divisor2; /* divides master clock to obtain conversion speed */
unsigned long extra_iobase; unsigned long extra_iobase;
}; };
static inline short munge_sample(short data) static inline unsigned short munge_sample(unsigned short data)
{ {
return (data >> 4) & 0xfff; return (data >> 4) & 0xfff;
} }
static void munge_sample_array(short *array, unsigned int num_elements) static void munge_sample_array(unsigned short *array, unsigned int num_elements)
{ {
unsigned int i; unsigned int i;
......
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