lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202307030302.s1bheEun-lkp@intel.com>
Date:   Mon, 3 Jul 2023 04:06:28 +0800
From:   kernel test robot <lkp@...el.com>
To:     Frank Oltmanns <frank@...manns.dev>,
        Maxime Ripard <maxime@...no.tech>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        Samuel Holland <samuel@...lland.org>,
        Andre Przywara <andre.przywara@....com>,
        Roman Beranek <me@...y.cz>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Frank Oltmanns <frank@...manns.dev>
Subject: Re: [PATCH v3 5/8] clk: sunxi-ng: nkm: Support finding closest rate

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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ