From: kernel test robot <lkp@intel.com>
To: Frank Oltmanns <frank@oltmanns.dev>,
Maxime Ripard <maxime@cerno.tech>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Andre Przywara <andre.przywara@arm.com>,
Roman Beranek <me@crly.cz>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
Frank Oltmanns <frank@oltmanns.dev>
Subject: Re: [PATCH v3 5/8] clk: sunxi-ng: nkm: Support finding closest rate
Date: Mon, 3 Jul 2023 04:06:28 +0800 [thread overview]
Message-ID: <202307030302.s1bheEun-lkp@intel.com> (raw)
In-Reply-To: <20230702-pll-mipi_set_rate_parent-v3-5-46dcb8aa9cbc@oltmanns.dev>
Hi Frank,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 6995e2de6891c724bfeb2db33d7b87775f913ad1]
url: https://github.com/intel-lab-lkp/linux/commits/Frank-Oltmanns/clk-sunxi-ng-nkm-consider-alternative-parent-rates-when-determining-rate/20230703-015726
base: 6995e2de6891c724bfeb2db33d7b87775f913ad1
patch link: https://lore.kernel.org/r/20230702-pll-mipi_set_rate_parent-v3-5-46dcb8aa9cbc%40oltmanns.dev
patch subject: [PATCH v3 5/8] clk: sunxi-ng: nkm: Support finding closest rate
config: riscv-rv32_defconfig (https://download.01.org/0day-ci/archive/20230703/202307030302.s1bheEun-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230703/202307030302.s1bheEun-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/202307030302.s1bheEun-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/clk/sunxi-ng/ccu_nkm.c:46:24: warning: variable 'tmp_diff' is uninitialized when used here [-Wuninitialized]
46 | tmp_diff = rate - tmp_diff;
| ^~~~~~~~
drivers/clk/sunxi-ng/ccu_nkm.c:33:27: note: initialize the variable 'tmp_diff' to silence this warning
33 | unsigned long tmp_diff;
| ^
| = 0
drivers/clk/sunxi-ng/ccu_nkm.c:93:24: warning: variable 'tmp_diff' is uninitialized when used here [-Wuninitialized]
93 | tmp_diff = rate - tmp_diff;
| ^~~~~~~~
drivers/clk/sunxi-ng/ccu_nkm.c:82:27: note: initialize the variable 'tmp_diff' to silence this warning
82 | unsigned long tmp_diff;
| ^
| = 0
2 warnings generated.
vim +/tmp_diff +46 drivers/clk/sunxi-ng/ccu_nkm.c
19
20 static unsigned long ccu_nkm_find_best_with_parent_adj(unsigned long *parent, unsigned long rate,
21 struct _ccu_nkm *nkm, struct clk_hw *phw,
22 unsigned long features)
23 {
24 unsigned long best_rate = 0, best_parent_rate = 0, tmp_parent = *parent;
25 unsigned long best_diff = ULONG_MAX;
26 unsigned long best_n = 0, best_k = 0, best_m = 0;
27 unsigned long _n, _k, _m;
28
29 for (_k = nkm->min_k; _k <= nkm->max_k; _k++) {
30 for (_n = nkm->min_n; _n <= nkm->max_n; _n++) {
31 for (_m = nkm->min_m; _m <= nkm->max_m; _m++) {
32 unsigned long tmp_rate;
33 unsigned long tmp_diff;
34
35 tmp_parent = clk_hw_round_rate(phw, rate * _m / (_n * _k));
36
37 tmp_rate = tmp_parent * _n * _k / _m;
38
39 if (features & CCU_FEATURE_CLOSEST_RATE) {
40 tmp_diff = rate > tmp_rate ?
41 rate - tmp_rate :
42 tmp_rate - rate;
43 } else {
44 if (tmp_rate > rate)
45 continue;
> 46 tmp_diff = rate - tmp_diff;
47 }
48
49 if (tmp_diff < best_diff) {
50 best_rate = tmp_rate;
51 best_parent_rate = tmp_parent;
52 best_diff = tmp_diff;
53 best_n = _n;
54 best_k = _k;
55 best_m = _m;
56 }
57 }
58 }
59 }
60
61 nkm->n = best_n;
62 nkm->k = best_k;
63 nkm->m = best_m;
64
65 *parent = best_parent_rate;
66
67 return best_rate;
68 }
69
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-02 20:07 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-02 17:55 [PATCH v3 0/8] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate Frank Oltmanns
2023-07-02 17:55 ` [PATCH v3 1/8] clk: sunxi-ng: nkm: consider alternative parent rates when determining rate Frank Oltmanns
2023-07-03 6:47 ` Maxime Ripard
2023-07-03 8:02 ` Frank Oltmanns
2023-07-02 17:55 ` [PATCH v3 2/8] clk: sunxi-ng: a64: allow pll-mipi to set parent's rate Frank Oltmanns
2023-07-03 6:47 ` Maxime Ripard
2023-07-02 17:55 ` [PATCH v3 3/8] clk: sunxi-ng: Add feature to find closest rate Frank Oltmanns
2023-07-03 6:48 ` Maxime Ripard
2023-07-02 17:55 ` [PATCH v3 4/8] clk: sunxi-ng: nm: Support finding " Frank Oltmanns
2023-07-03 7:24 ` Maxime Ripard
2023-07-03 8:46 ` Frank Oltmanns
2023-07-02 17:55 ` [PATCH v3 5/8] clk: sunxi-ng: nkm: " Frank Oltmanns
2023-07-02 20:06 ` kernel test robot [this message]
2023-07-03 7:17 ` Frank Oltmanns
2023-07-03 7:25 ` Maxime Ripard
2023-07-03 8:59 ` Frank Oltmanns
2023-07-03 11:36 ` Maxime Ripard
2023-07-03 7:33 ` Maxime Ripard
2023-07-02 17:55 ` [PATCH v3 6/8] clk: sunxi-ng: mux: " Frank Oltmanns
2023-07-03 7:38 ` Maxime Ripard
2023-07-03 9:17 ` Frank Oltmanns
2023-07-03 11:37 ` Maxime Ripard
2023-07-02 17:55 ` [PATCH v3 7/8] clk: sunxi-ng: div: " Frank Oltmanns
2023-07-03 7:39 ` Maxime Ripard
2023-07-02 17:55 ` [PATCH v3 8/8] clk: sunxi-ng: a64: select closest rate for pll-video0 Frank Oltmanns
2023-07-03 7:50 ` Maxime Ripard
2023-07-03 9:28 ` Frank Oltmanns
2023-07-03 7:51 ` [PATCH v3 0/8] clk: sunxi-ng: Consider alternative parent rates when determining NKM clock rate Maxime Ripard
2023-07-03 9:36 ` Frank Oltmanns
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202307030302.s1bheEun-lkp@intel.com \
--to=lkp@intel.com \
--cc=andre.przywara@arm.com \
--cc=frank@oltmanns.dev \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=llvm@lists.linux.dev \
--cc=maxime@cerno.tech \
--cc=me@crly.cz \
--cc=mturquette@baylibre.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=sboyd@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).