Re: [PATCH] gpio: sim: constify struct configfs_attribute

From: Thomas Weißschuh

Date: Mon Oct 19 2026 - 07:03:00 EST


On Mon, Oct 19, 2026 at 12:49:50PM +0200, Bartosz Golaszewski wrote:
> In preparation for the constification of configfs attributes, make the
> existing instances of struct configfs_attribute in gpio-sim const and
> use the new st_attrs_const field of struct config_item_type.
>
> Suggested-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/20261016105712-707634de-c955-4c66-957a-2bdb84bca3e4@xxxxxxxxxxxxx/
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
> ---
> drivers/gpio/gpio-sim.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index 0c73bec042670fc5706b4a93700e652cbaf3605e..acfe56af515dfd494f1f08bef5806524a6ef7f01 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -1037,7 +1037,7 @@ gpio_sim_device_config_live_store(struct config_item *item,
>
> CONFIGFS_ATTR(gpio_sim_device_config_, live);
>
> -static struct configfs_attribute *gpio_sim_device_config_attrs[] = {
> +static const struct configfs_attribute *gpio_sim_device_config_attrs[] = {

Here should be a second 'const' after the '*':

static const struct configfs_attribute *const gpio_sim_device_config_attrs[] ...

(Same for the others)

With these:

Reviewed-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>


> &gpio_sim_device_config_attr_dev_name,
> &gpio_sim_device_config_attr_live,
> NULL

(...)