Commit 8bd650f9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: comedi_buf: don't expose comedi_buf_write_n_allocated()

This helper function is only called by the comedi core in comedi_buf.c
and comedi_fops.c. For aesthetic reasons, move it to comedi_buf.c and
remove the inline. Move the prototype from comedidev.h to comedi_internal.h
so it's not exposed outside the comedi core.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5b2b64b7
...@@ -249,6 +249,11 @@ static unsigned int comedi_buf_munge(struct comedi_async *async, ...@@ -249,6 +249,11 @@ static unsigned int comedi_buf_munge(struct comedi_async *async,
return count; return count;
} }
unsigned int comedi_buf_write_n_allocated(struct comedi_async *async)
{
return async->buf_write_alloc_count - async->buf_write_count;
}
/* transfers a chunk from writer to filled buffer space */ /* transfers a chunk from writer to filled buffer space */
unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes) unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes)
{ {
......
...@@ -17,6 +17,7 @@ int comedi_find_board_minor(struct device *hardware_device); ...@@ -17,6 +17,7 @@ int comedi_find_board_minor(struct device *hardware_device);
int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long new_size); unsigned long new_size);
void comedi_buf_reset(struct comedi_async *async); void comedi_buf_reset(struct comedi_async *async);
unsigned int comedi_buf_write_n_allocated(struct comedi_async *async);
extern unsigned int comedi_default_buf_size_kb; extern unsigned int comedi_default_buf_size_kb;
extern unsigned int comedi_default_buf_maxsize_kb; extern unsigned int comedi_default_buf_maxsize_kb;
......
...@@ -448,10 +448,6 @@ void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset, ...@@ -448,10 +448,6 @@ void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
const void *source, unsigned int num_bytes); const void *source, unsigned int num_bytes);
void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset, void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
void *destination, unsigned int num_bytes); void *destination, unsigned int num_bytes);
static inline unsigned comedi_buf_write_n_allocated(struct comedi_async *async)
{
return async->buf_write_alloc_count - async->buf_write_count;
}
int comedi_alloc_subdevice_minor(struct comedi_device *dev, int comedi_alloc_subdevice_minor(struct comedi_device *dev,
struct comedi_subdevice *s); struct comedi_subdevice *s);
......
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