[PATCH] staging: fieldbus: arcx-anybus: constify static structs

Sven Van Asbroeck thesven73 at gmail.com
Mon Feb 8 13:21:05 UTC 2021


Hi Rikard, thank you for the contribution.

On Sun, Feb 7, 2021 at 3:25 PM Rikard Falkeborn
<rikard.falkeborn at gmail.com> wrote:
>
> Constify two static structs which are never modified, to allow the
> compiler to put them in read-only memory.
>
> The only usage of controller_attribute_group is to put its address in an
> array of pointers to const struct attribute_group, and the only usage of
> can_power_ops is to assign its address to the 'ops' field in the
> regulator_desc struct, which is a pointer to const struct regulator_ops.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>

Reviewed-by: Sven Van Asbroeck <TheSven73 at gmail.com>


More information about the devel mailing list