You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
staging:iio:buffer add a cache of the timestamp scan index.
Basically avoids looking it up lots of times. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5fb21c824e
commit
beb80600b0
@@ -106,6 +106,7 @@ struct iio_buffer {
|
|||||||
int scan_count;
|
int scan_count;
|
||||||
long *scan_mask;
|
long *scan_mask;
|
||||||
bool scan_timestamp;
|
bool scan_timestamp;
|
||||||
|
unsigned scan_index_timestamp;
|
||||||
const struct iio_buffer_access_funcs *access;
|
const struct iio_buffer_access_funcs *access;
|
||||||
const struct iio_buffer_setup_ops *setup_ops;
|
const struct iio_buffer_setup_ops *setup_ops;
|
||||||
struct list_head scan_el_dev_attr_list;
|
struct list_head scan_el_dev_attr_list;
|
||||||
|
|||||||
@@ -313,6 +313,9 @@ int iio_buffer_register(struct iio_dev *indio_dev,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error_cleanup_dynamic;
|
goto error_cleanup_dynamic;
|
||||||
attrcount += ret;
|
attrcount += ret;
|
||||||
|
if (channels[i].type == IIO_TIMESTAMP)
|
||||||
|
buffer->scan_index_timestamp =
|
||||||
|
channels[i].scan_index;
|
||||||
}
|
}
|
||||||
if (indio_dev->masklength && buffer->scan_mask == NULL) {
|
if (indio_dev->masklength && buffer->scan_mask == NULL) {
|
||||||
buffer->scan_mask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
|
buffer->scan_mask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
|
||||||
|
|||||||
Reference in New Issue
Block a user