* [PATCH] clk: sophgo: Fix a warning about void returns value
@ 2025-10-01 20:30 Tom Rini
2025-10-11 3:09 ` Yao Zi
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rini @ 2025-10-01 20:30 UTC (permalink / raw)
To: u-boot; +Cc: Lukasz Majewski, Sean Anderson, Yao Zi, Kongyang Liu
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.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Lukasz Majewski <lukma@denx.de> (maintainer:CLOCK)
Cc: Sean Anderson <seanga2@gmail.com> (maintainer:CLOCK)
Cc: Yao Zi <ziyao@disroot.org>
Cc: Kongyang Liu <seashell11234455@gmail.com>
---
drivers/clk/sophgo/clk-common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/sophgo/clk-common.h b/drivers/clk/sophgo/clk-common.h
index a9e83d0d6899..a18673f397c3 100644
--- a/drivers/clk/sophgo/clk-common.h
+++ b/drivers/clk/sophgo/clk-common.h
@@ -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__ */
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: sophgo: Fix a warning about void returns value
2025-10-01 20:30 [PATCH] clk: sophgo: Fix a warning about void returns value Tom Rini
@ 2025-10-11 3:09 ` Yao Zi
0 siblings, 0 replies; 2+ messages in thread
From: Yao Zi @ 2025-10-11 3:09 UTC (permalink / raw)
To: Tom Rini, u-boot; +Cc: Lukasz Majewski, Sean Anderson, Kongyang Liu
On Wed, Oct 01, 2025 at 02:30:57PM -0600, Tom Rini wrote:
> 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.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Yao Zi <ziyao@disroot.org>
milkv_duo_defconfig builds fine with this patch.
Regards,
Yao Zi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-11 3:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 20:30 [PATCH] clk: sophgo: Fix a warning about void returns value Tom Rini
2025-10-11 3:09 ` Yao Zi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.