Skip to contentSkip to conversation

iio:buffer_cb: Constify iio_cb_access

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Sep 15, 2013 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio:buffer_cb: Constify iio_cb_access

The iio_cb_access struct is never modified so we can mark it as const.

---
 drivers/iio/buffer_cb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/buffer_cb.c +1 -1
index 9d19ba7..f406889 100644
@@ -21,7 +21,7 @@ static int iio_buffer_cb_store_to(struct iio_buffer *buffer, u8 *data)
 	return cb_buff->cb(data, cb_buff->private);
 }
 
-static struct iio_buffer_access_funcs iio_cb_access = {
+static const struct iio_buffer_access_funcs iio_cb_access = {
 	.store_to = &iio_buffer_cb_store_to,
 };
 
Signature · 1 line
1.8.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Lars-Peter Clausen

The iio_cb_access struct is never modified so we can mark it as const.

Good point.

Applied to the togreg branch of iio.git

Thanks,

Jonathan

Quoted 18 lines
---
 drivers/iio/buffer_cb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/buffer_cb.c +1 -1
index 9d19ba7..f406889 100644
@@ -21,7 +21,7 @@ static int iio_buffer_cb_store_to(struct iio_buffer *buffer, u8 *data)
 	return cb_buff->cb(data, cb_buff->private);
 }
 
-static struct iio_buffer_access_funcs iio_cb_access = {
+static const struct iio_buffer_access_funcs iio_cb_access = {
 	.store_to = &iio_buffer_cb_store_to,
 };