* [linux-next:master 6189/12740] drivers/clk/microchip/clk-core.c:391:12: error: redefinition of 'roclk_determine_rate'
@ 2025-09-27 19:48 kernel test robot
2025-09-28 0:36 ` Brian Masney
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-09-27 19:48 UTC (permalink / raw)
To: Brian Masney; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 262858079afde6d367ce3db183c74d8a43a0e83f
commit: e9f039c08cdc9b38665aee9a88ae21f59c09ba8c [6189/12740] clk: microchip: core: convert from round_rate() to determine_rate()
config: mips-randconfig-r131-20250927 (https://download.01.org/0day-ci/archive/20250928/202509280327.jsapR0Ww-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project cafc064fc7a96b3979a023ddae1da2b499d6c954)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250928/202509280327.jsapR0Ww-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509280327.jsapR0Ww-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/clk/microchip/clk-core.c:391:12: error: redefinition of 'roclk_determine_rate'
391 | static int roclk_determine_rate(struct clk_hw *hw,
| ^
drivers/clk/microchip/clk-core.c:377:12: note: previous definition is here
377 | static int roclk_determine_rate(struct clk_hw *hw,
| ^
>> drivers/clk/microchip/clk-core.c:411:18: error: call to undeclared function 'roclk_round_rate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
411 | nearest_rate = roclk_round_rate(hw, req->rate, &parent_rate);
| ^
drivers/clk/microchip/clk-core.c:926:20: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
926 | .determine_rate = __clk_mux_determine_rate,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/microchip/clk-core.c:922:20: note: previous initialization is here
922 | .determine_rate = sclk_determine_rate,
| ^~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
vim +/roclk_determine_rate +391 drivers/clk/microchip/clk-core.c
ce6e1188465998 Purna Chandra Mandal 2016-05-13 390
ce6e1188465998 Purna Chandra Mandal 2016-05-13 @391 static int roclk_determine_rate(struct clk_hw *hw,
ce6e1188465998 Purna Chandra Mandal 2016-05-13 392 struct clk_rate_request *req)
ce6e1188465998 Purna Chandra Mandal 2016-05-13 393 {
ce6e1188465998 Purna Chandra Mandal 2016-05-13 394 struct clk_hw *parent_clk, *best_parent_clk = NULL;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 395 unsigned int i, delta, best_delta = -1;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 396 unsigned long parent_rate, best_parent_rate = 0;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 397 unsigned long best = 0, nearest_rate;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 398
ce6e1188465998 Purna Chandra Mandal 2016-05-13 399 /* find a parent which can generate nearest clkrate >= rate */
ce6e1188465998 Purna Chandra Mandal 2016-05-13 400 for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
ce6e1188465998 Purna Chandra Mandal 2016-05-13 401 /* get parent */
ce6e1188465998 Purna Chandra Mandal 2016-05-13 402 parent_clk = clk_hw_get_parent_by_index(hw, i);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 403 if (!parent_clk)
ce6e1188465998 Purna Chandra Mandal 2016-05-13 404 continue;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 405
ce6e1188465998 Purna Chandra Mandal 2016-05-13 406 /* skip if parent runs slower than target rate */
ce6e1188465998 Purna Chandra Mandal 2016-05-13 407 parent_rate = clk_hw_get_rate(parent_clk);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 408 if (req->rate > parent_rate)
ce6e1188465998 Purna Chandra Mandal 2016-05-13 409 continue;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 410
ce6e1188465998 Purna Chandra Mandal 2016-05-13 @411 nearest_rate = roclk_round_rate(hw, req->rate, &parent_rate);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 412 delta = abs(nearest_rate - req->rate);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 413 if ((nearest_rate >= req->rate) && (delta < best_delta)) {
ce6e1188465998 Purna Chandra Mandal 2016-05-13 414 best_parent_clk = parent_clk;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 415 best_parent_rate = parent_rate;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 416 best = nearest_rate;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 417 best_delta = delta;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 418
ce6e1188465998 Purna Chandra Mandal 2016-05-13 419 if (delta == 0)
ce6e1188465998 Purna Chandra Mandal 2016-05-13 420 break;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 421 }
ce6e1188465998 Purna Chandra Mandal 2016-05-13 422 }
ce6e1188465998 Purna Chandra Mandal 2016-05-13 423
ce6e1188465998 Purna Chandra Mandal 2016-05-13 424 /* if no match found, retain old rate */
ce6e1188465998 Purna Chandra Mandal 2016-05-13 425 if (!best_parent_clk) {
ce6e1188465998 Purna Chandra Mandal 2016-05-13 426 pr_err("%s:%s, no parent found for rate %lu.\n",
ce6e1188465998 Purna Chandra Mandal 2016-05-13 427 __func__, clk_hw_get_name(hw), req->rate);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 428 return clk_hw_get_rate(hw);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 429 }
ce6e1188465998 Purna Chandra Mandal 2016-05-13 430
ce6e1188465998 Purna Chandra Mandal 2016-05-13 431 pr_debug("%s,rate %lu, best_parent(%s, %lu), best %lu, delta %d\n",
ce6e1188465998 Purna Chandra Mandal 2016-05-13 432 clk_hw_get_name(hw), req->rate,
ce6e1188465998 Purna Chandra Mandal 2016-05-13 433 clk_hw_get_name(best_parent_clk), best_parent_rate,
ce6e1188465998 Purna Chandra Mandal 2016-05-13 434 best, best_delta);
ce6e1188465998 Purna Chandra Mandal 2016-05-13 435
ce6e1188465998 Purna Chandra Mandal 2016-05-13 436 if (req->best_parent_rate)
ce6e1188465998 Purna Chandra Mandal 2016-05-13 437 req->best_parent_rate = best_parent_rate;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 438
ce6e1188465998 Purna Chandra Mandal 2016-05-13 439 if (req->best_parent_hw)
ce6e1188465998 Purna Chandra Mandal 2016-05-13 440 req->best_parent_hw = best_parent_clk;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 441
ce6e1188465998 Purna Chandra Mandal 2016-05-13 442 return best;
ce6e1188465998 Purna Chandra Mandal 2016-05-13 443 }
ce6e1188465998 Purna Chandra Mandal 2016-05-13 444
:::::: The code at line 391 was first introduced by commit
:::::: ce6e1188465998820e7182455261b1f5d508ca17 CLK: microchip: Add Microchip PIC32 clock driver.
:::::: TO: Purna Chandra Mandal <purna.mandal@microchip.com>
:::::: CC: Ralf Baechle <ralf@linux-mips.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-next:master 6189/12740] drivers/clk/microchip/clk-core.c:391:12: error: redefinition of 'roclk_determine_rate'
2025-09-27 19:48 [linux-next:master 6189/12740] drivers/clk/microchip/clk-core.c:391:12: error: redefinition of 'roclk_determine_rate' kernel test robot
@ 2025-09-28 0:36 ` Brian Masney
0 siblings, 0 replies; 2+ messages in thread
From: Brian Masney @ 2025-09-28 0:36 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all, Stephen Boyd, linux-clk
On Sun, Sep 28, 2025 at 03:48:14AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 262858079afde6d367ce3db183c74d8a43a0e83f
> commit: e9f039c08cdc9b38665aee9a88ae21f59c09ba8c [6189/12740] clk: microchip: core: convert from round_rate() to determine_rate()
> config: mips-randconfig-r131-20250927 (https://download.01.org/0day-ci/archive/20250928/202509280327.jsapR0Ww-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project cafc064fc7a96b3979a023ddae1da2b499d6c954)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250928/202509280327.jsapR0Ww-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202509280327.jsapR0Ww-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> >> drivers/clk/microchip/clk-core.c:391:12: error: redefinition of 'roclk_determine_rate'
> 391 | static int roclk_determine_rate(struct clk_hw *hw,
> | ^
> drivers/clk/microchip/clk-core.c:377:12: note: previous definition is here
> 377 | static int roclk_determine_rate(struct clk_hw *hw,
> | ^
> >> drivers/clk/microchip/clk-core.c:411:18: error: call to undeclared function 'roclk_round_rate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 411 | nearest_rate = roclk_round_rate(hw, req->rate, &parent_rate);
> | ^
> drivers/clk/microchip/clk-core.c:926:20: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
> 926 | .determine_rate = __clk_mux_determine_rate,
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/clk/microchip/clk-core.c:922:20: note: previous initialization is here
> 922 | .determine_rate = sclk_determine_rate,
> | ^~~~~~~~~~~~~~~~~~~
> 1 warning and 2 errors generated.
I fixed this with:
https://lore.kernel.org/linux-clk/20250927-clk-microchip-core-compile-error-v2-1-3473dbae3625@redhat.com/T/#u
Sorry I had to send out a v2 with the tags.
Stephen: Since the original change hasn't landed in Linus's tree yet,
it's up to you if you want to squash this fix with my original commit.
Brian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-28 0:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-27 19:48 [linux-next:master 6189/12740] drivers/clk/microchip/clk-core.c:391:12: error: redefinition of 'roclk_determine_rate' kernel test robot
2025-09-28 0:36 ` Brian Masney
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.