[PATCH] regulator: scmi: Use int type to store negative error codes
Sudeep Holla
sudeep.holla at arm.com
Fri Aug 29 03:25:27 PDT 2025
On Fri, Aug 29, 2025 at 06:14:11PM +0800, Qianfeng Rong wrote:
> Change the 'ret' variable from u32 to int to store negative error codes or
> zero returned by of_property_read_u32().
>
> Storing the negative error codes in unsigned type, doesn't cause an issue
> at runtime but it's ugly as pants. Additionally, assigning negative error
> codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
> flag is enabled.
>
> No effect on runtime.
>
Reviewed-by: Sudeep Holla <sudeep.holla at arm.com>
Mark,
Not sure if it is worth adding:
Fixes: 0fbeae70ee7c ("regulator: add SCMI driver")
Especially if value > 0 is not treated as error in some driver using
regulator APIs.
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list