[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <42f522b5-6406-4bef-8180-3a431ee884a5@app.fastmail.com>
Date: Wed, 13 Dec 2023 07:32:14 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: guoren <guoren@...nel.org>, "Arnd Bergmann" <arnd@...nel.org>
Cc: "Pavel Machek" <pavel@....cz>, "Lee Jones" <lee@...nel.org>,
"Chen-Yu Tsai" <wens@...e.org>,
"Jernej Skrabec" <jernej.skrabec@...il.com>,
"Samuel Holland" <samuel@...lland.org>,
"Nathan Chancellor" <nathan@...nel.org>,
"Palmer Dabbelt" <palmer@...osinc.com>,
"Nick Desaulniers" <ndesaulniers@...gle.com>,
"Bill Wendling" <morbo@...gle.com>,
"Justin Stitt" <justinstitt@...gle.com>,
linux-leds@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH] leds: sun50i-a100: avoid division-by-zero warning
On Wed, Dec 13, 2023, at 02:26, Guo Ren wrote:
> On Wed, Dec 13, 2023 at 5:45 AM Arnd Bergmann <arnd@...nel.org> wrote:
>> {
>> 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.
Arnd
Powered by blists - more mailing lists