Thread (5 messages) 5 messages, 4 authors, 2023-12-13

Re: [PATCH] leds: sun50i-a100: avoid division-by-zero warning

From: Guo Ren <guoren@kernel.org>
Date: 2023-12-13 14:51:32
Also in: linux-leds, linux-sunxi, lkml, llvm

On Wed, Dec 13, 2023 at 2:32 PM Arnd Bergmann [off-list ref] wrote:
On Wed, Dec 13, 2023, at 02:26, Guo Ren wrote:
quoted
On Wed, Dec 13, 2023 at 5:45 AM Arnd Bergmann [off-list ref] wrote:
quoted
 {
        const struct sun50i_a100_ledc_timing *timing = &priv->timing;
        unsigned long mod_freq = clk_get_rate(priv->mod_clk);
-       u32 cycle_ns = NSEC_PER_SEC / mod_freq;
+       u32 cycle_ns;
        u32 control;

+       if (!mod_freq)
+               return;
+
Shall we need err_disable_bus_clk?

+ static int sun50i_a100_ledc_set_timing(struct sun50i_a100_ledc *priv)
- static void sun50i_a100_ledc_set_timing(struct sun50i_a100_ledc *priv)
I'm not worried about it too much, as there is already an error check
on priv->mod_clk being unavailable during initialization. The case that
the warning is about is just for build-testing on architectures that
don't even use COMMON_CLK.
Okay

Reviewed-by: Guo Ren <guoren@kernel.org>
     Arnd


-- 
Best Regards
 Guo Ren

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help