Skip to contentSkip to conversation

clk: sophgo: Fix a warning about void returns value

PATCH In review Tom Rini 2 participants 2 messages Oct 1, 2025 – Oct 11, 2025

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 clk: sophgo: Fix a warning about void returns value

The cv1800b_clk_setfield function returns void, but was doing "return writel(...);" and while seemingly having a void function return a void function is not a warning, when readl is a macro this problem is shown. Correct the code to instead simply call writel.

---
Cc: Lukasz Majewski <[email protected]> (maintainer:CLOCK)
Cc: Sean Anderson <[email protected]> (maintainer:CLOCK)
Cc: Yao Zi <[email protected]>
Cc: Kongyang Liu <[email protected]>

---
 drivers/clk/sophgo/clk-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sophgo/clk-common.h +1 -1
index a9e83d0d6899..a18673f397c3 100644
@@ -70,7 +70,7 @@ cv1800b_clk_setfield(void *base, struct cv1800b_clk_regfield *field, u32 val)
 	u32 new_val = (readl(base + field->offset) & ~mask) |
 		      ((val << field->shift) & mask);
 
-	return writel(new_val, base + field->offset);
+	writel(new_val, base + field->offset);
 }
 
 #endif /* __CLK_SOPHGO_COMMON_H__ */
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tom Rini

The cv1800b_clk_setfield function returns void, but was doing "return writel(...);" and while seemingly having a void function return a void function is not a warning, when readl is a macro this problem is shown. Correct the code to instead simply call writel.

milkv_duo_defconfig builds fine with this patch.

Regards,
Yao Zi