[PATCH v2 0/8] regulator: Use container_of_const() when all types are const
Matti Vaittinen
mazziesaccount at gmail.com
Wed Nov 26 22:51:08 PST 2025
Thanks again Krzysztof! :)
On 26/11/2025 19:40, Krzysztof Kozlowski wrote:
> Changes in v2:
> - Rebase on regulator/for-next, which does not have pf1550-regulator.c
> so drop this part.
> - Link to v1: https://patch.msgid.link/20251126-container-of-const-regulator-v1-0-eeec378144d4@oss.qualcomm.com
>
> Use container_of_const(), which is preferred over container_of(), when
> the argument 'ptr' and returned pointer are already const, for better
> code safety and readability.
>
> Some drivers already have const everywhere, so container_of_const can be
> directly used. In few other drivers, the final pointer can be constified
> that way.
>
> Best regards,
> Krzysztof
>
> ---
> Krzysztof Kozlowski (8):
> regulator: bd71815: Constify pointers to 'regulator_desc' wrap struct
> regulator: bd71828: Constify pointers to 'regulator_desc' wrap struct
> regulator: bd718x7: Constify pointers to 'regulator_desc' wrap struct
> regulator: bd96801: Constify pointers to 'regulator_desc' wrap struct
For the above:
Reviewed-by: Matti Vaittinen <mazziesaccount at gmail.com>
Yours,
-- Matti
More information about the Linux-mediatek
mailing list