Skip to content

Commit 9d35d06

Browse files
qianfengrongbroonie
authored andcommitted
regulator: scmi: Use int type to store negative error codes
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. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Fixes: 0fbeae7 ("regulator: add SCMI driver") Link: https://patch.msgid.link/20250829101411.625214-1-rongqianfeng@vivo.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 899fb38 commit 9d35d06

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/regulator/scmi-regulator.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ static int process_scmi_regulator_of_node(struct scmi_device *sdev,
257257
struct device_node *np,
258258
struct scmi_regulator_info *rinfo)
259259
{
260-
u32 dom, ret;
260+
u32 dom;
261+
int ret;
261262

262263
ret = of_property_read_u32(np, "reg", &dom);
263264
if (ret)

0 commit comments

Comments
 (0)