Re: [PATCH 6/7] fs/sysfs/group: make attribute_group pointers const

From: Greg Kroah-Hartman
Date: Mon Oct 09 2023 - 13:26:08 EST


On Mon, Oct 09, 2023 at 06:57:39PM +0200, Max Kellermann wrote:
> This allows passing arrays of const pointers. The goal is to make
> lots of global variables "const" to allow them to live in the
> ".rodata" section.

I'm all for doing this type of work, but this is going to be rough. You
sent patch 6/7 that hit almost all subsystems at once :(

Also, the code:

> -int driver_add_groups(struct device_driver *drv, const struct attribute_group **groups);
> -void driver_remove_groups(struct device_driver *drv, const struct attribute_group **groups);
> +int driver_add_groups(struct device_driver *drv, const struct attribute_group *const*groups);
> +void driver_remove_groups(struct device_driver *drv, const struct attribute_group *const*groups);
> void device_driver_detach(struct device *dev);

"*const*groups"? That's a parsing nightmare, really hard for humans to
read and understand. Doesn't checkpatch complain about this?

thanks,

greg k-h