diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-11-05 04:56:00 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-05 15:39:51 -0500 |
commit | bd6880477a3d73270edead88f4b806504998e5d8 (patch) | |
tree | 700423605c971c504d1bfb027d5d53975a271300 /drivers/staging/iio/adc/ad7887.h | |
parent | 3c7f0c2b1150eae8683a98a5a9143d81edfc2762 (diff) |
staging:iio:ad7887: Preallocate sample buffer
We know that the sample buffer will at most need to hold two 16 bit samples and
the 64 bit aligned 64 bit timestamp. Preallocate a buffer large enough to hold
this instead of allocating and freeing it each time a sample is read.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/adc/ad7887.h')
-rw-r--r-- | drivers/staging/iio/adc/ad7887.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/ad7887.h b/drivers/staging/iio/adc/ad7887.h index 2e09e54fc9c..71e50925e06 100644 --- a/drivers/staging/iio/adc/ad7887.h +++ b/drivers/staging/iio/adc/ad7887.h | |||
@@ -72,9 +72,11 @@ struct ad7887_state { | |||
72 | /* | 72 | /* |
73 | * DMA (thus cache coherency maintenance) requires the | 73 | * DMA (thus cache coherency maintenance) requires the |
74 | * transfer buffers to live in their own cache lines. | 74 | * transfer buffers to live in their own cache lines. |
75 | * Buffer needs to be large enough to hold two 16 bit samples and a | ||
76 | * 64 bit aligned 64 bit timestamp. | ||
75 | */ | 77 | */ |
76 | 78 | unsigned char data[ALIGN(4, sizeof(s64)) + sizeof(s64)] | |
77 | unsigned char data[4] ____cacheline_aligned; | 79 | ____cacheline_aligned; |
78 | }; | 80 | }; |
79 | 81 | ||
80 | enum ad7887_supported_device_ids { | 82 | enum ad7887_supported_device_ids { |