* [bug report] clk: berlin: Migrate to clk_hw based registration and OF APIs
@ 2016-11-16 14:07 Dan Carpenter
2016-11-16 18:54 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-11-16 14:07 UTC (permalink / raw)
To: stephen.boyd; +Cc: linux-clk
Hello Stephen Boyd,
The patch f6475e298297: "clk: berlin: Migrate to clk_hw based
registration and OF APIs" from Aug 16, 2016, leads to the following
static checker warning:
drivers/clk/berlin/bg2.c:688 berlin2_clock_setup()
warn: did you mean to pass the address of 'clk_data'
drivers/clk/berlin/bg2.c
674 hws[CLKID_TWD] =
675 clk_hw_register_fixed_factor(NULL, "twd", "cpu", 0, 1, 3);
676
677 /* check for errors on leaf clocks */
678 for (n = 0; n < MAX_CLKS; n++) {
679 if (!IS_ERR(hws[n]))
680 continue;
681
682 pr_err("%s: Unable to register leaf clock %d\n",
683 np->full_name, n);
684 goto bg2_fail;
685 }
686
687 /* register clk-provider */
688 of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &clk_data);
^^^^^^^^^
Pretty sure this was overlooked when we switched to allocating this
with kmalloc(). Should just be passing clk_data. Same for the
following warnings as well:
drivers/clk/berlin/bg2q.c:385 berlin2q_clock_setup() warn: did you mean to pass the address of 'clk_data'
drivers/clk/clk-efm32gg.c:85 efm32gg_cmu_init() warn: did you mean to pass the address of 'clk_data'
689
690 return;
691
692 bg2_fail:
693 iounmap(gbase);
694 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] clk: berlin: Migrate to clk_hw based registration and OF APIs
2016-11-16 14:07 [bug report] clk: berlin: Migrate to clk_hw based registration and OF APIs Dan Carpenter
@ 2016-11-16 18:54 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2016-11-16 18:54 UTC (permalink / raw)
To: Dan Carpenter; +Cc: stephen.boyd, linux-clk
On 11/16, Dan Carpenter wrote:
> Hello Stephen Boyd,
>
> The patch f6475e298297: "clk: berlin: Migrate to clk_hw based
> registration and OF APIs" from Aug 16, 2016, leads to the following
> static checker warning:
>
> drivers/clk/berlin/bg2.c:688 berlin2_clock_setup()
> warn: did you mean to pass the address of 'clk_data'
>
> drivers/clk/berlin/bg2.c
> 674 hws[CLKID_TWD] =
> 675 clk_hw_register_fixed_factor(NULL, "twd", "cpu", 0, 1, 3);
> 676
> 677 /* check for errors on leaf clocks */
> 678 for (n = 0; n < MAX_CLKS; n++) {
> 679 if (!IS_ERR(hws[n]))
> 680 continue;
> 681
> 682 pr_err("%s: Unable to register leaf clock %d\n",
> 683 np->full_name, n);
> 684 goto bg2_fail;
> 685 }
> 686
> 687 /* register clk-provider */
> 688 of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &clk_data);
> ^^^^^^^^^
> Pretty sure this was overlooked when we switched to allocating this
> with kmalloc(). Should just be passing clk_data. Same for the
> following warnings as well:
>
> drivers/clk/berlin/bg2q.c:385 berlin2q_clock_setup() warn: did you mean to pass the address of 'clk_data'
> drivers/clk/clk-efm32gg.c:85 efm32gg_cmu_init() warn: did you mean to pass the address of 'clk_data'
Thanks! I guess there are new checks in smatch that have been
introduced lately to find these problems? I'll go fix all these
up now and add a Reported-by appropriately.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-16 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 14:07 [bug report] clk: berlin: Migrate to clk_hw based registration and OF APIs Dan Carpenter
2016-11-16 18:54 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).