Skip to contentSkip to conversation

iio: sw_device: make the function argument as const

PATCH In review Bhumika Goyal 2 participants 2 messages Oct 11, 2017 – Oct 14, 2017 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: sw_device: make the function argument as const

This is a follow-up patch for:
https://patchwork.kernel.org/patch/9999649/

Make the argument of the function iio_swd_group_init_type_name const as it is only passed to the function config_group_init_type_name having the argument as const.

---
This change allows a lot of config_item_type structures to be const.

 include/linux/iio/sw_device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/sw_device.h +1 -1
index fa79319..8642b91 100644
@@ -60,7 +60,7 @@ struct iio_sw_device *to_iio_sw_device(struct config_item *item)
 static inline
 void iio_swd_group_init_type_name(struct iio_sw_device *d,
 				  const char *name,
-				  struct config_item_type *type)
+				  const struct config_item_type *type)
 {
 #if IS_ENABLED(CONFIG_CONFIGFS_FS)
 	config_group_init_type_name(&d->group, name, type);
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 8 lines · On Wed, 11 Oct 2017 16:05:47 +0200 Bhumika Goyal <[email protected]> wrote:

This is a follow-up patch for:
https://patchwork.kernel.org/patch/9999649/

Make the argument of the function iio_swd_group_init_type_name const as it is only passed to the function config_group_init_type_name having the argument as const.

As mentioned before, please put together a single series with the dependencies and the patches making use of them.

Otherwise, this is going to take a long time to merge.

Jonathan

Quoted 19 lines

---
This change allows a lot of config_item_type structures to be const.

 include/linux/iio/sw_device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/sw_device.h +1 -1
index fa79319..8642b91 100644
@@ -60,7 +60,7 @@ struct iio_sw_device *to_iio_sw_device(struct config_item *item)
 static inline
 void iio_swd_group_init_type_name(struct iio_sw_device *d,
 				  const char *name,
-				  struct config_item_type *type)
+				  const struct config_item_type *type)
 {
 #if IS_ENABLED(CONFIG_CONFIGFS_FS)
 	config_group_init_type_name(&d->group, name, type);