* [bug report] clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS
@ 2018-06-21 8:06 Dan Carpenter
2018-07-13 10:04 ` Gregory CLEMENT
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-06-21 8:06 UTC (permalink / raw)
To: gregory.clement; +Cc: linux-clk
Hello Gregory CLEMENT,
The patch 9818a7a4fd10: "clk: mvebu: armada-37xx-periph: prepare cpu
clk to be used with DVFS" from Nov 30, 2017, leads to the following
static checker warning:
drivers/clk/mvebu/armada-37xx-periph.c:432 clk_pm_cpu_get_parent()
warn: signedness bug returning '(-22)'
drivers/clk/mvebu/armada-37xx-periph.c
418 static u8 clk_pm_cpu_get_parent(struct clk_hw *hw)
^^
419 {
420 struct clk_pm_cpu *pm_cpu = to_clk_pm_cpu(hw);
421 int num_parents = clk_hw_get_num_parents(hw);
422 u32 val;
423
424 if (armada_3700_pm_dvfs_is_enabled(pm_cpu->nb_pm_base)) {
425 val = armada_3700_pm_dvfs_get_cpu_parent(pm_cpu->nb_pm_base);
426 } else {
427 val = readl(pm_cpu->reg_mux) >> pm_cpu->shift_mux;
428 val &= pm_cpu->mask_mux;
429 }
430
431 if (val >= num_parents)
432 return -EINVAL;
^^^^^^^
433
434 return val;
435 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug report] clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS
2018-06-21 8:06 [bug report] clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS Dan Carpenter
@ 2018-07-13 10:04 ` Gregory CLEMENT
0 siblings, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2018-07-13 10:04 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-clk
Hi Dan,
On jeu., juin 21 2018, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Hello Gregory CLEMENT,
>
> The patch 9818a7a4fd10: "clk: mvebu: armada-37xx-periph: prepare cpu
> clk to be used with DVFS" from Nov 30, 2017, leads to the following
> static checker warning:
>
> drivers/clk/mvebu/armada-37xx-periph.c:432 clk_pm_cpu_get_parent()
> warn: signedness bug returning '(-22)'
Thanks, I finally took time to take care of it and I am going to post a
fix.
Gregory
>
> drivers/clk/mvebu/armada-37xx-periph.c
> 418 static u8 clk_pm_cpu_get_parent(struct clk_hw *hw)
> ^^
> 419 {
> 420 struct clk_pm_cpu *pm_cpu = to_clk_pm_cpu(hw);
> 421 int num_parents = clk_hw_get_num_parents(hw);
> 422 u32 val;
> 423
> 424 if (armada_3700_pm_dvfs_is_enabled(pm_cpu->nb_pm_base)) {
> 425 val = armada_3700_pm_dvfs_get_cpu_parent(pm_cpu->nb_pm_base);
> 426 } else {
> 427 val = readl(pm_cpu->reg_mux) >> pm_cpu->shift_mux;
> 428 val &= pm_cpu->mask_mux;
> 429 }
> 430
> 431 if (val >= num_parents)
> 432 return -EINVAL;
> ^^^^^^^
> 433
> 434 return val;
> 435 }
>
> regards,
> dan carpenter
--
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [bug report] clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS
@ 2018-01-12 20:31 Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-01-12 20:31 UTC (permalink / raw)
To: gregory.clement; +Cc: linux-clk
Hello Gregory CLEMENT,
The patch 9818a7a4fd10: "clk: mvebu: armada-37xx-periph: prepare cpu
clk to be used with DVFS" from Nov 30, 2017, leads to the following
static checker warning:
drivers/clk/mvebu/armada-37xx-periph.c:432 clk_pm_cpu_get_parent()
warn: signedness bug returning '(-22)'
drivers/clk/mvebu/armada-37xx-periph.c
418 static u8 clk_pm_cpu_get_parent(struct clk_hw *hw)
^^
419 {
420 struct clk_pm_cpu *pm_cpu = to_clk_pm_cpu(hw);
421 int num_parents = clk_hw_get_num_parents(hw);
422 u32 val;
423
424 if (armada_3700_pm_dvfs_is_enabled(pm_cpu->nb_pm_base)) {
425 val = armada_3700_pm_dvfs_get_cpu_parent(pm_cpu->nb_pm_base);
426 } else {
427 val = readl(pm_cpu->reg_mux) >> pm_cpu->shift_mux;
428 val &= pm_cpu->mask_mux;
429 }
430
431 if (val >= num_parents)
432 return -EINVAL;
^^^^^^^
I always forget what the correct error code is here...
433
434 return val;
435 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-13 10:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 8:06 [bug report] clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS Dan Carpenter
2018-07-13 10:04 ` Gregory CLEMENT
-- strict thread matches above, loose matches on Subject: below --
2018-01-12 20:31 Dan Carpenter
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.