[PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP

Xukai Wang posted 1 patch 2 days, 4 hours ago
drivers/clk/clk-k230.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP
Posted by Xukai Wang 2 days, 4 hours ago
Fix all sparse warnings detected during LKP randconfig testing:
- Replace plain integer 0 with NULL.
- Add static modifier to k230_plls and k230_pll_divs.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202605220724.j4ZeM3KI-lkp@intel.com/
Signed-off-by: Xukai Wang <kingxukai@zohomail.com>
---
 drivers/clk/clk-k230.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-k230.c b/drivers/clk/clk-k230.c
index d883a1e1118e..cfc437038e4e 100644
--- a/drivers/clk/clk-k230.c
+++ b/drivers/clk/clk-k230.c
@@ -270,12 +270,12 @@ static const struct clk_ops k230_clk_ops_mul_div = {
 	.recalc_rate	= k230_clk_get_rate_mul_div,
 };
 
-K230_CLK_PLL_FORMAT(pll0, 0, CLK_IS_CRITICAL, 0);
-K230_CLK_PLL_FORMAT(pll1, 1, CLK_IS_CRITICAL, 0);
-K230_CLK_PLL_FORMAT(pll2, 2, CLK_IS_CRITICAL, 0);
-K230_CLK_PLL_FORMAT(pll3, 3, CLK_IS_CRITICAL, 0);
+K230_CLK_PLL_FORMAT(pll0, 0, CLK_IS_CRITICAL, NULL);
+K230_CLK_PLL_FORMAT(pll1, 1, CLK_IS_CRITICAL, NULL);
+K230_CLK_PLL_FORMAT(pll2, 2, CLK_IS_CRITICAL, NULL);
+K230_CLK_PLL_FORMAT(pll3, 3, CLK_IS_CRITICAL, NULL);
 
-struct k230_pll *k230_plls[] = {
+static struct k230_pll *k230_plls[] = {
 	&pll0,
 	&pll1,
 	&pll2,
@@ -296,7 +296,7 @@ K230_CLK_FIXED_FACTOR_FORMAT(pll3_div2, 1, 2, 0, &pll3.hw);
 K230_CLK_FIXED_FACTOR_FORMAT(pll3_div3, 1, 3, 0, &pll3.hw);
 K230_CLK_FIXED_FACTOR_FORMAT(pll3_div4, 1, 4, 0, &pll3.hw);
 
-struct clk_fixed_factor *k230_pll_divs[] = {
+static struct clk_fixed_factor *k230_pll_divs[] = {
 	&pll0_div2,
 	&pll0_div3,
 	&pll0_div4,
-- 
2.34.1
Re: [PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP
Posted by Conor Dooley 1 day, 21 hours ago
On Fri, May 22, 2026 at 08:59:12PM +0800, Xukai Wang wrote:
> Fix all sparse warnings detected during LKP randconfig testing:
> - Replace plain integer 0 with NULL.
> - Add static modifier to k230_plls and k230_pll_divs.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202605220724.j4ZeM3KI-lkp@intel.com/
> Signed-off-by: Xukai Wang <kingxukai@zohomail.com>

Forgot to reply earlier, but I went and squashed this in.

Cheers,
Conor.
Re: [PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP
Posted by Xukai Wang 1 day, 10 hours ago
On 2026/5/23 04:39, Conor Dooley wrote:
> On Fri, May 22, 2026 at 08:59:12PM +0800, Xukai Wang wrote:
>> Fix all sparse warnings detected during LKP randconfig testing:
>> - Replace plain integer 0 with NULL.
>> - Add static modifier to k230_plls and k230_pll_divs.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202605220724.j4ZeM3KI-lkp@intel.com/
>> Signed-off-by: Xukai Wang <kingxukai@zohomail.com>
> Forgot to reply earlier, but I went and squashed this in.
Thanks Conor!

-- 
Best regards,
Xukai Wang
Re: [PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP
Posted by Conor Dooley 1 day, 3 hours ago
On Sat, May 23, 2026 at 03:00:15PM +0800, Xukai Wang wrote:
> 
> On 2026/5/23 04:39, Conor Dooley wrote:
> > On Fri, May 22, 2026 at 08:59:12PM +0800, Xukai Wang wrote:
> >> Fix all sparse warnings detected during LKP randconfig testing:
> >> - Replace plain integer 0 with NULL.
> >> - Add static modifier to k230_plls and k230_pll_divs.
> >>
> >> Reported-by: kernel test robot <lkp@intel.com>
> >> Closes: https://lore.kernel.org/oe-kbuild-all/202605220724.j4ZeM3KI-lkp@intel.com/
> >> Signed-off-by: Xukai Wang <kingxukai@zohomail.com>
> > Forgot to reply earlier, but I went and squashed this in.
> Thanks Conor!

I dunno if you saw my message about giving what I have in my
branches a go, but if you could try what's in the riscv-soc-for-next
branch, that'd be great. Just to make sure that I have all the bits in
place.

Cheers,
Conor.
Re: [PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP
Posted by Xukai Wang 9 hours ago
On 2026/5/23 22:02, Conor Dooley wrote:
> On Sat, May 23, 2026 at 03:00:15PM +0800, Xukai Wang wrote:
>> On 2026/5/23 04:39, Conor Dooley wrote:
>>> On Fri, May 22, 2026 at 08:59:12PM +0800, Xukai Wang wrote:
>>>> Fix all sparse warnings detected during LKP randconfig testing:
>>>> - Replace plain integer 0 with NULL.
>>>> - Add static modifier to k230_plls and k230_pll_divs.
>>>>
>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>> Closes: https://lore.kernel.org/oe-kbuild-all/202605220724.j4ZeM3KI-lkp@intel.com/
>>>> Signed-off-by: Xukai Wang <kingxukai@zohomail.com>
>>> Forgot to reply earlier, but I went and squashed this in.
>> Thanks Conor!
> I dunno if you saw my message about giving what I have in my
> branches a go, but if you could try what's in the riscv-soc-for-next
> branch, that'd be great. Just to make sure that I have all the bits in
> place.
I have successfully tested your riscv-soc-for-next branch on K230
hardware. The clock controller probes correctly, and clk_summary shows
all PLLs and clocks are running as expected.

-- 
Best regards,
Xukai Wang
Re: [PATCH] clk: canaan: k230: Fix sparse warnings reported by LKP
Posted by Xukai Wang 1 day, 2 hours ago

于 2026年5月23日 GMT+08:00 22:02:31,Conor Dooley <conor@kernel.org> 写道:
>On Sat, May 23, 2026 at 03:00:15PM +0800, Xukai Wang wrote:
>> 
>> On 2026/5/23 04:39, Conor Dooley wrote:
>> > On Fri, May 22, 2026 at 08:59:12PM +0800, Xukai Wang wrote:
>> >> Fix all sparse warnings detected during LKP randconfig testing:
>> >> - Replace plain integer 0 with NULL.
>> >> - Add static modifier to k230_plls and k230_pll_divs.
>> >>
>> >> Reported-by: kernel test robot <lkp@intel.com>
>> >> Closes: https://lore.kernel.org/oe-kbuild-all/202605220724.j4ZeM3KI-lkp@intel.com/
>> >> Signed-off-by: Xukai Wang <kingxukai@zohomail.com>
>> > Forgot to reply earlier, but I went and squashed this in.
>> Thanks Conor!
>
>I dunno if you saw my message about giving what I have in my
>branches a go, but if you could try what's in the riscv-soc-for-next
>branch, that'd be great. Just to make sure that I have all the bits in
>place.
OK, I will pull riscv-soc-for-next branch and test it on K230 hardware immediately. And then report back the test results as soon as possible.